stop using Moo as a test package
[catagits/Catalyst-Runtime.git] / t / undef_encoding_regression.t
CommitLineData
a050c28a 1use utf8;
2use warnings;
3use strict;
4use Test::More;
5use HTTP::Request::Common;
6use HTTP::Message::PSGI ();
7use Encode 2.21 'decode_utf8', 'encode_utf8', 'encode';
8
9{
10 package MyApp::Controller::Root;
11 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
12
13 use base 'Catalyst::Controller';
14
15 sub heart :Local Args(1) {
16 my ($self, $c, $arg) = @_;
17
18 Test::More::is $c->req->query_parameters->{a}, 111;
19 Test::More::is $c->req->query_parameters->{b}, 222;
20 Test::More::is $arg, 1;
21
22 $c->response->content_type('text/html');
23 $c->response->body("<p>This is path local</p>");
24 }
25
26 package MyApp;
27 use Catalyst;
28
29 MyApp->config(encoding => undef);
30
31 Test::More::ok(MyApp->setup, 'setup app');
32}
33
34use Catalyst::Test 'MyApp';
35
36{
37 my $res = request "/root/heart/1?a=111&b=222";
38 is $res->code, 200, 'OK';
39 is $res->content, '<p>This is path local</p>';
40}
41
42done_testing;