[Catalyst-commits] r6424 - in trunk/Catalyst-Engine-Wx/t: . lib
lib/TestApp/Controller lib/TestApp/View lib/TestAppWx
eriam at dev.catalyst.perl.org
eriam at dev.catalyst.perl.org
Wed May 23 20:03:43 GMT 2007
Author: eriam
Date: 2007-05-23 20:03:42 +0100 (Wed, 23 May 2007)
New Revision: 6424
Added:
trunk/Catalyst-Engine-Wx/t/5_test_kwalitee.t
Removed:
trunk/Catalyst-Engine-Wx/t/4_test_kwalitee.t
Modified:
trunk/Catalyst-Engine-Wx/t/3_wx.t
trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm
trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm
trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm
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:
New test for bootstrapping another controller and rename test kwalitee.
Modified: trunk/Catalyst-Engine-Wx/t/3_wx.t
===================================================================
--- trunk/Catalyst-Engine-Wx/t/3_wx.t 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/3_wx.t 2007-05-23 19:03:42 UTC (rev 6424)
@@ -1,5 +1,5 @@
-use Test::More tests => 6;
+use Test::More tests => 8;
BEGIN {
use lib "./lib";
@@ -13,6 +13,14 @@
require TestApp;
-TestApp->run();
+TestApp->config(
+ name => 'TestApp',
+);
+TestApp->setup;
+
+TestApp->run({
+ bootstrap => '/',
+});
+
1;
Deleted: trunk/Catalyst-Engine-Wx/t/4_test_kwalitee.t
===================================================================
--- trunk/Catalyst-Engine-Wx/t/4_test_kwalitee.t 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/4_test_kwalitee.t 2007-05-23 19:03:42 UTC (rev 6424)
@@ -1,3 +0,0 @@
-use Test::More;
-eval { require Test::Kwalitee; Test::Kwalitee->import() };
-plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;
Copied: trunk/Catalyst-Engine-Wx/t/5_test_kwalitee.t (from rev 6412, trunk/Catalyst-Engine-Wx/t/4_test_kwalitee.t)
===================================================================
--- trunk/Catalyst-Engine-Wx/t/5_test_kwalitee.t (rev 0)
+++ trunk/Catalyst-Engine-Wx/t/5_test_kwalitee.t 2007-05-23 19:03:42 UTC (rev 6424)
@@ -0,0 +1,3 @@
+use Test::More;
+eval { require Test::Kwalitee; Test::Kwalitee->import() };
+plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;
Modified: trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestApp/Controller/Root.pm 2007-05-23 19:03:42 UTC (rev 6424)
@@ -20,11 +20,27 @@
sub event_with_params : Local {
my ( $self, $c ) = @_;
- ok ($c->request->parameters->{test} eq 'data', 'received parameter');
+ if (defined $c->request->parameters->{scalar}) {
+ ok ($c->request->parameters->{scalar} eq 'data', 'received scalar');
+ }
+
+ if (defined $c->request->parameters->{array}) {
+ ok ( ref( $c->request->parameters->{array} ) eq 'ARRAY', 'received array');
+ ok ( $c->request->parameters->{array}[0] eq 'test', 'received array');
+
+ }
+
+ $c->stash->{class} = 'shutdown';
+}
- $c->stash->{template} = 'shutdown';
+sub forward : Local {
+ my ( $self, $c ) = @_;
+
+ ok (1, 'forwarded_view');
+ $c->stash->{class} = 'forwarded_view';
}
+
sub end : ActionClass('RenderView') {}
Modified: trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestApp/View/Wx.pm 2007-05-23 19:03:42 UTC (rev 6424)
@@ -5,7 +5,7 @@
__PACKAGE__->config({
NAMESPACE => 'TestAppWx',
- CATALYST_VAR => 'Catalyst',
+ CATALYST_VAR => 'Catalyst',
});
Modified: trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestApp.pm 2007-05-23 19:03:42 UTC (rev 6424)
@@ -4,16 +4,18 @@
use warnings;
use Catalyst::Runtime '5.70';
+use Catalyst;
-use Catalyst qw/ConfigLoader/;
-
our $VERSION = '0.01';
-# Configure the application.
-__PACKAGE__->config( name => 'TestApp' );
+## Configure the application.
+#__PACKAGE__->config(
+# name => 'TestApp',
+# bootstrap => '/'
+#);
# Start the application
-__PACKAGE__->setup;
+#__PACKAGE__->setup;
1;
Modified: trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/default.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/default.pm 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/default.pm 2007-05-23 19:03:42 UTC (rev 6424)
@@ -1,19 +1,22 @@
package TestAppWx::default;
use strict;
+use warnings;
use Test::More;
use Wx ':everything';
-use Catalyst::Engine::Wx::Event qw(EVT_BUTTON EVT_CLOSE EVT);
+use Catalyst::Engine::Wx::Event qw(EVT);
+use base 'Wx::Frame';
+
sub new {
my ($class, $catalyst, $c ) = @_;
- my $self = Wx::Frame->new( undef, -1, 'Test', [0, 0], [475,300] );
+ my $self = $class->SUPER::new( undef, -1, 'Test', [0, 0], [475,300] );
$self->Show(0);
- ok (ref($self) eq 'Wx::Frame', 'Wx::Frame');
+ ok (ref($self) eq 'TestAppWx::default', 'TestAppWx::default');
EVT( $self, '/textctrl' );
Modified: trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/shutdown.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/shutdown.pm 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/shutdown.pm 2007-05-23 19:03:42 UTC (rev 6424)
@@ -1,19 +1,22 @@
package TestAppWx::shutdown;
use strict;
+use warnings;
use Test::More;
use Wx ':everything';
use Catalyst::Engine::Wx::Event qw(EVT_QUIT);
+use base 'Catalyst::View::Wx';
+
sub new {
my ($class, $catalyst, $c ) = @_;
my $self = $c->stash->{_parent};
- ok (ref($self) eq 'Wx::Frame', 'Wx::Frame');
+ ok (ref($self) eq 'TestAppWx::default', 'TestAppWx::default');
- EVT_QUIT();
+ EVT_QUIT;
return;
}
Modified: trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/textctrl.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/textctrl.pm 2007-05-23 18:51:59 UTC (rev 6423)
+++ trunk/Catalyst-Engine-Wx/t/lib/TestAppWx/textctrl.pm 2007-05-23 19:03:42 UTC (rev 6424)
@@ -1,19 +1,22 @@
package TestAppWx::textctrl;
use strict;
+use warnings;
use Test::More;
use Wx ':everything';
use Catalyst::Engine::Wx::Event qw(EVT_BUTTON EVT_CLOSE EVT);
+use base 'Wx::TextCtrl';
+
sub new {
my ($class, $catalyst, $c ) = @_;
- my $self = Wx::TextCtrl->new( $c->stash->{_parent}, -1, 'Test', [105,15],[140,30] );
+ my $self = $class->SUPER::new( $c->stash->{_parent}, -1, 'Test', [105,15],[140,30] );
- ok (ref($self) eq 'Wx::TextCtrl', 'Wx::TextCtrl');
+ ok (ref($self) eq 'TestAppWx::textctrl', 'TestAppWx::textctrl');
- EVT( $c->stash->{_parent}, '/event_with_params', { test => 'data' } );
+ EVT( $c->stash->{_parent}, '/event_with_params', { scalar => 'data', array => ['test', 'of', 'array'] } );
return 1;
}
More information about the Catalyst-commits
mailing list