Fix test warning
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Serialize / Controller / REST.pm
index 0499f1d..4e7d1ba 100644 (file)
@@ -1,9 +1,9 @@
 package Test::Serialize::Controller::REST;
 
-use warnings;
-use strict;
+use namespace::autoclean;
+use Moose;
 
-use base qw/Catalyst::Controller::REST/;
+BEGIN { extends qw/Catalyst::Controller::REST/ };
 
 __PACKAGE__->config(
     'namespace' => '',
@@ -25,17 +25,20 @@ __PACKAGE__->config(
         'text/x-php-serialization' =>
              [ 'Data::Serializer', 'PHP::Serialization' ],
         'text/view'   => [ 'View', 'Simple' ],
+        'text/explodingview' => [ 'View', 'Awful' ],
         'text/broken' => 'Broken',
     },
 );
 
 sub monkey_put : Local : ActionClass('Deserialize') {
     my ( $self, $c ) = @_;
-       if ( ref($c->req->data) eq "HASH" ) {
-               $c->res->output( $c->req->data->{'sushi'} );
-       } else {
-               $c->res->output(1);
-       }
+    if ( ref($c->req->data) eq "HASH" ) {
+        my $out = ($c->req->data->{'sushi'}||'') . ($c->req->data->{'chicken'}||'');
+        utf8::encode($out);
+        $c->res->output( $out );
+    } else {
+        $c->res->output(1);
+    }
 }
 
 sub monkey_get : Local : ActionClass('Serialize') {
@@ -44,4 +47,3 @@ sub monkey_get : Local : ActionClass('Serialize') {
 }
 
 1;
-