391a2cdc30783f8621ea26e5e474266ae9306e45
[catagits/Catalyst-Runtime.git] / t / lib / TestAppEncoding / Controller / Root.pm
1 package TestAppEncoding::Controller::Root;
2 use strict;
3 use warnings;
4 use base 'Catalyst::Controller';
5 use Test::More;
6
7 __PACKAGE__->config->{namespace} = '';
8
9 sub binary : Local {
10     my ($self, $c) = @_;
11     $c->res->body(do { open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; binmode($fh); local $/ = undef; <$fh>; });
12 }
13
14 sub binary_utf8 : Local {
15     my ($self, $c) = @_;
16     $c->forward('binary');
17     my $str = $c->res->body;
18     utf8::upgrade($str);
19     ok utf8::is_utf8($str), 'Body is variable width encoded string';
20     $c->res->body($str);
21 }
22
23 sub end : Private {
24     my ($self,$c) = @_;
25 }
26
27 1;