[Catalyst-commits] r6374 - in trunk/Catalyst-Engine-Wx/t: . lib
lib/TestApp lib/TestApp/Controller lib/TestApp/View lib/TestAppWx
eriam at dev.catalyst.perl.org
eriam at dev.catalyst.perl.org
Tue May 8 20:06:36 GMT 2007
Author: eriam
Date: 2007-05-08 20:06:36 +0100 (Tue, 08 May 2007)
New Revision: 6374
Added:
trunk/Catalyst-Engine-Wx/t/3_wx.t
trunk/Catalyst-Engine-Wx/t/lib/
trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm
trunk/Catalyst-Engine-Wx/t/lib/TestApp/
trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/
trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm
trunk/Catalyst-Engine-Wx/t/lib/TestApp/Model/
trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/
trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm
trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/
trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/default.pm
trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/shutdown.pm
trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/textctrl.pm
Log:
First test with events and flow
Added: trunk/Catalyst-Engine-Wx/t/3_wx.t
===================================================================
--- trunk/Catalyst-Engine-Wx/t/3_wx.t (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/3_wx.t 2007-05-08 19:06:36 UTC (rev 6374)
@@ -0,0 +1,18 @@
+
+use Test::More tests => 6;
+
+BEGIN {
+ use lib "./lib";
+
+ $ENV{CATALYST_ENGINE} ||= 'Wx';
+ require Catalyst::Engine::Wx;
+}
+
+use strict;
+use warnings;
+
+require TestApp;
+
+TestApp->run();
+
+1;
Added: trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm 2007-05-08 19:06:36 UTC (rev 6374)
@@ -0,0 +1,31 @@
+package TestApp::Controller::Root;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+use Test::More;
+
+__PACKAGE__->config->{namespace} = '';
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ ok (1, 'default action');
+}
+
+sub textctrl : Local {
+ my ( $self, $c ) = @_;
+ ok (1, 'textctrl action');
+}
+
+sub event_with_params : Local {
+ my ( $self, $c ) = @_;
+
+ ok ($c->request->parameters->{test} eq 'data', 'received parameter');
+
+ $c->stash->{template} = 'shutdown';
+}
+
+sub end : ActionClass('RenderView') {}
+
+
+1;
Property changes on: trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm 2007-05-08 19:06:36 UTC (rev 6374)
@@ -0,0 +1,12 @@
+package TestApp::View::Wx;
+
+use strict;
+use base 'Catalyst::View::Wx';
+
+__PACKAGE__->config({
+ NAMESPACE => 'TestAppWx',
+ CATALYST_VAR => 'Catalyst',
+});
+
+
+1;
Property changes on: trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm 2007-05-08 19:06:36 UTC (rev 6374)
@@ -0,0 +1,19 @@
+package TestApp;
+
+use strict;
+use warnings;
+
+use Catalyst::Runtime '5.70';
+
+use Catalyst qw/ConfigLoader/;
+
+our $VERSION = '0.01';
+
+# Configure the application.
+__PACKAGE__->config( name => 'TestApp' );
+
+# Start the application
+__PACKAGE__->setup;
+
+
+1;
Property changes on: trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/default.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/default.pm (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/default.pm 2007-05-08 19:06:36 UTC (rev 6374)
@@ -0,0 +1,23 @@
+package TestAppWx::default;
+
+use strict;
+
+use Test::More;
+use Wx ':everything';
+use Catalyst::Engine::Wx::Event qw(EVT_BUTTON EVT_CLOSE EVT);
+
+sub new {
+ my ($class, $catalyst, $c ) = @_;
+
+ my $self = Wx::Frame->new( undef, -1, 'Test', [0, 0], [475,300] );
+
+ $self->Show(0);
+
+ ok (ref($self) eq 'Wx::Frame', 'Wx::Frame');
+
+ EVT( $self, '/textctrl' );
+
+ return 1;
+}
+
+1;
Added: trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/shutdown.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/shutdown.pm (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/shutdown.pm 2007-05-08 19:06:36 UTC (rev 6374)
@@ -0,0 +1,21 @@
+package TestAppWx::shutdown;
+
+use strict;
+
+use Test::More;
+use Wx ':everything';
+use Catalyst::Engine::Wx::Event qw(EVT_QUIT);
+
+sub new {
+ my ($class, $catalyst, $c ) = @_;
+
+ my $self = $c->stash->{_parent};
+
+ ok (ref($self) eq 'Wx::Frame', 'Wx::Frame');
+
+ EVT_QUIT();
+
+ return;
+}
+
+1;
Added: trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/textctrl.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/textctrl.pm (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/textctrl.pm 2007-05-08 19:06:36 UTC (rev 6374)
@@ -0,0 +1,21 @@
+package TestAppWx::textctrl;
+
+use strict;
+
+use Test::More;
+use Wx ':everything';
+use Catalyst::Engine::Wx::Event qw(EVT_BUTTON EVT_CLOSE EVT);
+
+sub new {
+ my ($class, $catalyst, $c ) = @_;
+
+ my $self = Wx::TextCtrl->new( $c->stash->{_parent}, -1, 'Test', [105,15],[140,30] );
+
+ ok (ref($self) eq 'Wx::TextCtrl', 'Wx::TextCtrl');
+
+ EVT( $c->stash->{_parent}, '/event_with_params', { test => 'data' } );
+
+ return 1;
+}
+
+1;
More information about the Catalyst-commits
mailing list