Catalyst-Runtime

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


5.90118 - 2018-05-01
  - fix handling of fragments in uri_for when path is an unblessed string (GH#160)
  - ensure catalyst.pl is included with dist
  - drop IO::Scalar prereq
  - include optional test prereqs as develop prereqs
  - remove unused developer prereq on Catalyst::Engine::PSGI
  - use namespace::clean consistently rather than namespace::autoclean
  - use JSON for test metadata to avoid needing YAML
  - use JSON::MaybeXS consistently in code
  - drop unused prereq of HTTP::Request::AsCGI
  - drop unneeded prereq of Class::Data::Inheritable
  - fix tests to cope with changes in new versions of Time::HiRes
  - POD typo and syntax fixes

5.90117 - 2018-01-21
  - Fixed errors in distribution packaging

5.90116 - 2018-01-19
  - Switch from Module::Install to Distar (solves problems that MI has with newer Perl) haarg++
  - Killed Test::Aggregate since its clearly doomed

Changes  view on Meta::CPAN

   - Various minor typo fixes.

  New features:
   - Allow passing additional arguments to action constructors.

5.80018 2010-01-12 22:24:20

  Bug fixed:
   - Call ->canonical on URI derived from $ENV{REQUEST_URI} to get
     paths correctly decoded. This bug was previously hidden by a bug
     in HTTP::Request::AsCGI.

  Documentation:
   - Clarify that uri_for_action works on private paths, with example.
   - Clarify documentation about debug

  Deprecations:
   - Saying use Catalyst::Test; (without an application name or () to stop
     the importer running is now deprecated and will issue a warning.
     You should be saying use Catalyst::Test ();

Changes  view on Meta::CPAN


  Documentation:

   - Fix Pod nits (RT#52370)

5.80015 2009-12-02 15:13:54
  Bug fixes:
   - Fix bug in Catalyst::Engine which would cause a request parsing to end
     prematurely in the hypothetical case where calling $engine->read returned
     the single character '0'.
   - Fix failing tests when combined with new HTTP::Request::AsCGI

  Documentation:
   - Improved documentation on read and read_chunk methods in Catalyst::Engine.
   - Fix reversal of SCRIPT_NAME and PATH_INFO in previously correct nginx
     FastCGI documentation introduced in _02.

5.80014_02 2009-12-01 00:55:23
  Bug fixes:
   - Fix reporting the wrong Content-Length if the response body is an
     upgraded string. Strings mean the same thing whether or not they are

Changes  view on Meta::CPAN

     produce the same output either way, but bytes::length returns too big
     values for upgraded strings containing characters >127
   - Fix t/live_fork.t with bleadperl (RT#52100)
   - Set $ENV{PATH_INFO} from $ENV{REQUEST_URI} combined with
     $ENV{SCRIPT_NAME} if possible. This is many web servers always fully
     decode PATH_INFO including URI reserved characters. This allows us to
     tell foo%2cbar from foo%252cbar, and fixes issues with %2F in paths
     being incorrectly decoded, resulting in too many path parts (rather
     than 1 path part containing a /, on some web servers (at least nginx).
     (RT#50082)
   - Require new HTTP::Request::AsCGI so that it fully decodes $ENV{PATH_INFO}
     in non CGI contexts. (RT#50082)

  Refactoring / cleanups:
   - NoTabs and Pod tests moved to t/author so that they're not run
     (and then skipped) normally.

  Documentation:
    - Fix Pod nits in Catalyst::Response (RT#51818)

5.80014_01 2009-11-22 20:01:23

Changes  view on Meta::CPAN

        - Fix the unattached chain debug table for endpoints with no
          parents at all.
        - Turn off test aggregation by default. Only aggregate if the
          AGGREGATE_TESTS environment variable is set and a recent
          Test::Aggregate is available.
        - Bump to MooseX::MethodAttributes 0.09, to gain the
          get_nearest_methods_with_attributes method allowing methods without
          attributes in a subclass to override those with attributes in a
          superclass. This fixes CatalystX::CRUD's method of overriding /
          disabling functionality from base controllers.
        - Bump HTTP::Request::AsCGI dependency to avoid broken version
        - Bump Moose dependency to latest version to fix metaclass
          incompatibility issues in some cases.
        - Additional tests for setup_stats method.
        - Fix log levels in Catalyst::Log to be properly additive.
        - Fix RT#43375 by sorting results before testing them
        - Fixes for uri_for_action when using Catalyst::DispatchType::Regex
          + tests from RT#39369 (norbi)
        - Partial rewrite and reorganization of the C3 docs in
          Catalyst::Upgrading based on feedback from kiffin
        - If you make your application class immutable and turn off

Changes  view on Meta::CPAN


5.7099_03 2008-07-20 10:10:00
        - Fix regressions for regexp fallback in model(), view() and controller()
        - Added the supplied argument to the regexp fallback warning for easier
          debugging
        - Ensure ACCEPT_CONTEXT is called for results from component()

5.7099_02 2008-07-16 19:10:00
        - Added PathPrefix attribute
        - Removed Catalyst::Build; we've long since moved to Module::Install
        - Updated Catalyst::Test docs to mention the use of HTTP::Request
          objects

5.7099_01 2008-06-25 22:36:00
        - Refactored component resolution (component(), models(), model(), et al). We now
          throw warnings for two reasons:
          1) model() or view() was called with no arguments, and two results are returned
             -- set default_(model|view), current_(model|view) or current_(model|view)_instance
             instead
          2) you call a component resolution method with a string, and it resorts to a regexp
             fallback wherein a result is returned -- if you really want to search, call the

Changes  view on Meta::CPAN

        - Added PAR support
        - Added keep-alive support and bug fixes to HTTP engine.
          (Sascha Kiefer)
        - Added daemonize option to FastCGI engine. (Sam Vilain)

5.56   2005-11-16 10:33:00
        - Fixed FastCGI engine to not clobber the global %ENV on each
          request. (Sam Vilain)
        - Updated benchmarking to work with detach
        - Fixed dispatcher, so $c->req->action(undef) works again
        - Updated Catalyst::Test to use HTTP::Request::AsCGI
        - Added -pidfile to external FastCGI server.

5.55    2005-11-15 12:55:00
        - Fixed multiple cookie handling

5.54    2005-11-14 22:55:00
        - Fixed a Module::Pluggable::Fast related bug

5.53    2005-11-14 15:55:00
        - Removed t/04prereq.t that was testing for non-required

Changes  view on Meta::CPAN

        - made a damn typo *AAAAAAAAAAAAAAHHHH!!!*

4.31  2005-03-22 02:00:00
        - fixed inheritance (Christian Hansen)
        - previous release was borked!
          fixed that, but you have to regenerate the scripts again :(

4.30  2005-03-21 23:00:00
        - more documentation (Andrew Ford)
        - added connection informations (Christian Hansen)
        - HTTP::Request support in Catalyst::Test (Christian Hansen)
        - moved cgi.pl to nph-cgi.pl
        - added Catalyst::Engine::Server (Christian Hansen)
        - removed Catalyst::Test::server
        - updated helper scripts
          IMPORTANT: note that you have to regenerate script/server.pl,
          script/cgi-server.pl and script/cgi.pl (now nph-cgi.pl)

4.28  2005-03-19 22:00:00
        - fixed isa tree (Christian Hansen)
        - added script/cgi-server.pl, so no more server restarting after

META.json  view on Meta::CPAN

            "Class::C3::Adopt::NEXT" : "0.07",
            "Class::Load" : "0.12",
            "Data::Dump" : "0",
            "Data::OptList" : "0",
            "Devel::InnerPackage" : "0",
            "Encode" : "2.49",
            "HTML::Entities" : "0",
            "HTML::HeadParser" : "0",
            "HTTP::Body" : "1.22",
            "HTTP::Headers" : "1.64",
            "HTTP::Request" : "5.814",
            "HTTP::Response" : "5.813",
            "Hash::MultiValue" : "0",
            "JSON::MaybeXS" : "1.000000",
            "LWP" : "5.837",
            "List::Util" : "1.45",
            "MRO::Compat" : "0",
            "Module::Pluggable" : "4.7",
            "Moose" : "2.1400",
            "MooseX::Emulate::Class::Accessor::Fast" : "0.00903",
            "MooseX::Getopt" : "0.48",

META.json  view on Meta::CPAN

            "Tree::Simple::Visitor::FindByUID" : "0",
            "Try::Tiny" : "0.17",
            "URI" : "1.65",
            "URI::ws" : "0.03",
            "namespace::clean" : "0.23",
            "perl" : "5.008003"
         }
      },
      "test" : {
         "requires" : {
            "HTTP::Request::Common" : "0",
            "HTTP::Status" : "0",
            "Test::Fatal" : "0",
            "Test::More" : "0.88"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://github.com/perl-catalyst/catalyst-runtime/issues"

META.yml  view on Meta::CPAN

---
abstract: 'The Catalyst Framework Runtime'
author:
  - 'Sebastian Riedel <sri@cpan.org>'
build_requires:
  HTTP::Request::Common: '0'
  HTTP::Status: '0'
  Test::Fatal: '0'
  Test::More: '0.88'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html

META.yml  view on Meta::CPAN

  Class::C3::Adopt::NEXT: '0.07'
  Class::Load: '0.12'
  Data::Dump: '0'
  Data::OptList: '0'
  Devel::InnerPackage: '0'
  Encode: '2.49'
  HTML::Entities: '0'
  HTML::HeadParser: '0'
  HTTP::Body: '1.22'
  HTTP::Headers: '1.64'
  HTTP::Request: '5.814'
  HTTP::Response: '5.813'
  Hash::MultiValue: '0'
  JSON::MaybeXS: '1.000000'
  LWP: '5.837'
  List::Util: '1.45'
  MRO::Compat: '0'
  Module::Pluggable: '4.7'
  Moose: '2.1400'
  MooseX::Emulate::Class::Accessor::Fast: '0.00903'
  MooseX::Getopt: '0.48'

Makefile.PL  view on Meta::CPAN

  prereqs => {
    configure => { requires => {
      'ExtUtils::MakeMaker'   => 0,
    } },
    build => { requires => {
    } },
    test => {
      requires => {
        'Test::Fatal' => 0,
        'Test::More' => '0.88',
        'HTTP::Request::Common' => 0,
        'HTTP::Status' => 0,
      },
    },
    runtime => {
      requires => {
        'perl'                  => 5.008003,
        'List::Util'            => '1.45',
        'namespace::clean'      => '0.23',
        'MooseX::Emulate::Class::Accessor::Fast' => '0.00903',
        'Class::Load'           => '0.12',

Makefile.PL  view on Meta::CPAN

        'MooseX::MethodAttributes::Role::AttrContainer::Inheritable' => '0.24',
        'Carp'                  => '1.25',
        'Class::C3::Adopt::NEXT' => '0.07',
        'CGI::Simple::Cookie'   => '1.109',
        'Data::Dump'            => 0,
        'Data::OptList'         => 0,
        'HTML::Entities'        => 0,
        'HTML::HeadParser'      => 0,
        'HTTP::Body'            => '1.22',
        'HTTP::Headers'         => '1.64',
        'HTTP::Request'         => '5.814',
        'HTTP::Response'        => '5.813',
        'Module::Pluggable'     => '4.7',
        'Path::Class'           => '0.09',
        'Scalar::Util'          => 0,
        'Sub::Exporter'         => 0,
        'Text::SimpleTable'     => '0.03',
        'Time::HiRes'           => 0,
        'Tree::Simple'          => '1.15',
        'Tree::Simple::Visitor::FindByUID' => 0,
        'Try::Tiny'             => '0.17',

lib/Catalyst/Test.pm  view on Meta::CPAN


    # Helper
    script/test.pl

    # Tests
    use Catalyst::Test 'TestApp';
    my $content  = get('index.html');           # Content as string
    my $response = request('index.html');       # HTTP::Response object
    my($res, $c) = ctx_request('index.html');      # HTTP::Response & context object

    use HTTP::Request::Common;
    my $response = request POST '/foo', [
        bar => 'baz',
        something => 'else'
    ];

    # Run tests against a remote server
    CATALYST_SERVER='http://localhost:3000/' prove -r -l lib/ t/

    use Catalyst::Test 'TestApp';
    use Test::More tests => 1;

lib/Catalyst/Test.pm  view on Meta::CPAN

    like( get( '/whichhost', { host => 'yourapp.com' } ), qr/served by yourapp.com/ );
    {
        local $Catalyst::Test::default_host = 'otherapp.com';
        like( get('/whichhost'), qr/served by otherapp.com/ );
    }

=head1 DESCRIPTION

This module allows you to make requests to a Catalyst application either without
a server, by simulating the environment of an HTTP request using
L<HTTP::Request::AsCGI> or remotely if you define the CATALYST_SERVER
environment variable. This module also adds a few Catalyst-specific
testing methods as displayed in the method section.

The L<get|/"$content = get( ... )"> and L<request|/"$res = request( ... );">
functions take either a URI or an L<HTTP::Request> object.

=head1 INLINE TESTS WILL NO LONGER WORK

While it used to be possible to inline a whole test app into a C<.t> file for
a distribution, this will no longer work.

The convention is to place your L<Catalyst> test apps into C<t/lib> in your
distribution. E.g.: C<t/lib/TestApp.pm>, C<t/lib/TestApp/Controller/Root.pm>,
etc..  Multiple test apps can be used in this way.

lib/Catalyst/Test.pm  view on Meta::CPAN

to decode it into characters.

=head2 $res = request( ... );

Returns an L<HTTP::Response> object. Accepts an optional hashref for request
header configuration; currently only supports setting 'host' value.

    my $res = request('foo/bar?test=1');
    my $virtual_res = request('foo/bar?test=1', {host => 'virtualhost.com'});

Alternately, you can pass in an L<HTTP::Request::Common> object to set arbitrary
request headers.

    my $res = request(GET '/foo/bar',
        X-Foo => 'Bar',
        Authorization => 'Bearer JWT_HERE',
        ...
    );

=head2 ($res, $c) = ctx_request( ... );

lib/Catalyst/Test.pm  view on Meta::CPAN

Fetches the given URL and returns whether the content matches the regexp. An
optional third argument can be given to specify the name of the test.

=head2 contenttype_is($url, $type [, $test_name ])

Verify the given URL has a content type of $type and optionally specify a test name.

=head1 SEE ALSO

L<Catalyst>, L<Test::WWW::Mechanize::Catalyst>,
L<Test::WWW::Selenium::Catalyst>, L<Test::More>, L<HTTP::Request::Common>

=head1 AUTHORS

Catalyst Contributors, see Catalyst.pm

=head1 COPYRIGHT

This library is free software. You can redistribute it and/or modify it under
the same terms as Perl itself.

lib/Catalyst/UTF8.pod  view on Meta::CPAN

will respect to set the encoding (accept-charset="utf-8").  And lastly there are some javascript
based tricks and workarounds for even more odd cases (just search the web for this will return
a number of approaches.  Hopefully as more compliant browsers become popular these edge cases
will fade.

B<NOTE>  It is possible for a form POST multipart response (normally a file upload) to contain
inline content with mixed content character sets and encoding.  For example one might create
a POST like this:

    use utf8;
    use HTTP::Request::Common;

    my $utf8 = 'test ♥';
    my $shiftjs = 'test テスト';
    my $req = POST '/root/echo_arg',
        Content_Type => 'form-data',
          Content =>  [
            arg0 => 'helloworld',
            Encode::encode('UTF-8','♥') => Encode::encode('UTF-8','♥♥'),
            arg1 => [
              undef, '',

lib/Catalyst/Utils.pm  view on Meta::CPAN

package Catalyst::Utils;
use strict;
use warnings;

use File::Spec;
use HTTP::Request;
use Path::Class;
use URI;
use Carp qw/croak/;
use Cwd;
use Class::Load 'is_class_loaded';
use String::RewritePrefix;
use Class::Load ();
use namespace::clean;
use Devel::InnerPackage;
use Moose::Util;

lib/Catalyst/Utils.pm  view on Meta::CPAN


sub prefix {
    my ( $class, $name ) = @_;
    my $prefix = &class2prefix($class);
    $name = "$prefix/$name" if $prefix;
    return $name;
}

=head2 request($uri)

Returns an L<HTTP::Request> object for a uri.

=cut

sub request {
    my $request = shift;
    unless ( ref $request ) {
        if ( $request =~ m/^http/i ) {
            $request = URI->new($request);
        }
        else {
            $request = URI->new( 'http://localhost' . $request );
        }
    }
    unless ( ref $request eq 'HTTP::Request' ) {
        $request = HTTP::Request->new( 'GET', $request );
    }
    return $request;
}

=head2 ensure_class_loaded($class_name, \%opts)

Loads the class unless it already has been loaded.

If $opts{ignore_loaded} is true always tries the require whether the package
already exists or not. Only pass this if you're either (a) sure you know the

t/abort-chain-1.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More tests => 1;
use HTTP::Request::Common;

BEGIN {
    package TestApp::Controller::Root;
    $INC{'TestApp/Controller/Root.pm'} = __FILE__;
    use Moose;
    use MooseX::MethodAttributes;
    extends 'Catalyst::Controller';

    has counter => (is => 'rw', isa => 'Int', default => sub { 0 });
    sub increment {

t/abort-chain-2.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More tests => 1;
use HTTP::Request::Common;

BEGIN {
    package TestApp::Controller::Root;
    $INC{'TestApp/Controller/Root.pm'} = __FILE__;
    use Moose;
    use MooseX::MethodAttributes;
    extends 'Catalyst::Controller';

    has counter => (is => 'rw', isa => 'Int', default => sub { 0 });
    sub increment {

t/abort-chain-3.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More tests => 1;
use HTTP::Request::Common;

BEGIN {
    package TestApp::Controller::Root;
    $INC{'TestApp/Controller/Root.pm'} = __FILE__;
    use Moose;
    use MooseX::MethodAttributes;
    extends 'Catalyst::Controller';

    has counter => (is => 'rw', isa => 'Int', default => sub { 0 });
    sub increment {

t/aggregate/live_component_controller_httpmethods.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use HTTP::Request::Common qw/GET POST DELETE PUT/;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Catalyst::Test 'TestApp';

sub OPTIONS {
    HTTP::Request->new('OPTIONS', @_);
}

is(request(GET    '/httpmethods/foo')->content, 'get');
is(request(POST   '/httpmethods/foo')->content, 'post');
is(request(DELETE '/httpmethods/foo')->content, 'default');

is(request(GET    '/httpmethods/bar')->content, 'get or post');
is(request(POST   '/httpmethods/bar')->content, 'get or post');
is(request(DELETE '/httpmethods/bar')->content, 'default');

t/aggregate/live_engine_request_auth.t  view on Meta::CPAN

use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 7;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use HTTP::Headers;
use HTTP::Request::Common;

{
    my $creq;

    my $request = GET(
        'http://localhost/dump/request',
        'Authorization' => 'Basic dGVzdDoxMjM0NQ==',
    );

    ok( my $response = request($request), 'Request' );

t/aggregate/live_engine_request_body.t  view on Meta::CPAN

use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 23;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use HTTP::Headers;
use HTTP::Request::Common;

{
    my $creq;

    my $request = POST(
        'http://localhost/dump/request/',
        'Content-Type' => 'text/plain',
        'Content'      => 'Hello Catalyst'
    );

t/aggregate/live_engine_request_body_demand.t  view on Meta::CPAN

use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 12;
use Catalyst::Test 'TestAppOnDemand';

use Catalyst::Request;
use HTTP::Headers;
use HTTP::Request::Common;

# Test a simple POST request to make sure body parsing
# works in on-demand mode.
SKIP:
{
    if ( $ENV{CATALYST_SERVER} ) {
        skip "Using remote server", 12;
    }

    {

t/aggregate/live_engine_request_cookies.t  view on Meta::CPAN


use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 13;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use CGI::Simple::Cookie;
use HTTP::Headers;
use HTTP::Request::Common;
use URI;

{
    my $creq;

    my $request = GET( 'http://localhost/dump/request',
        'Cookie' => 'Catalyst=Cool; Cool=Catalyst', );

    ok( my $response = request($request), 'Request' );
    ok( $response->is_success, 'Response Successful 2xx' );

t/aggregate/live_engine_request_env.t  view on Meta::CPAN

BEGIN {
    $EXPECTED_ENV_VAR = "CATALYSTTEST$$"; # has to be uppercase otherwise fails on Win32
    $EXPECTED_ENV_VAL = "Test env value " . rand(100000);
}

use Test::More;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use HTTP::Headers;
use HTTP::Request::Common;

my $response = request("http://localhost/dump/env", {
    extra_env => { $EXPECTED_ENV_VAR => $EXPECTED_ENV_VAL },
});

ok( $response, 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );

my $env;

t/aggregate/live_engine_request_headers.t  view on Meta::CPAN

use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 18;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use HTTP::Headers;
use HTTP::Request::Common;

{
    my $creq;

    my $request = GET( 'http://localhost/dump/request',
        'User-Agent'       => 'MyAgen/1.0',
        'X-Whats-Cool'     => 'Catalyst',
        'X-Multiple'       => [ 1 .. 5 ],
        'X-Forwarded-Host' => 'frontend.server.com',
        'X-Forwarded-For'  => '192.168.1.1, 1.2.3.4',

t/aggregate/live_engine_request_parameters.t  view on Meta::CPAN

use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 56;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use HTTP::Headers;
use HTTP::Request::Common;

{
    my $creq;

    my $parameters = { 'a' => [qw(A b C d E f G)], };

    my $query = join( '&', map { 'a=' . $_ } @{ $parameters->{a} } );

    ok( my $response = request("http://localhost/dump/request?$query"),
        'Request' );

t/aggregate/live_engine_request_prepare_parameters.t  view on Meta::CPAN

use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 8;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use HTTP::Headers;
use HTTP::Request::Common;

{
    my $creq;

    my $parameters = { 'a' => [qw(A b C d E f G)], };

    my $query = join( '&', map { 'a=' . $_ } @{ $parameters->{a} } );

    ok( my $response = request("http://localhost/dump/prepare_parameters?$query"),
        'Request' );

t/aggregate/live_engine_request_remote_user.t  view on Meta::CPAN

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 7;
use Catalyst::Test 'TestApp';

use Catalyst::Request;
use HTTP::Request::Common;

{
    my $creq;

    my $request = GET(
        'http://localhost/dump/request',
    );

    ok( my $response = request($request, { extra_env => { REMOTE_USER => 'dwc' } }), 'Request' );
    ok( $response->is_success, 'Response Successful 2xx' );

t/aggregate/live_engine_request_uploads.t  view on Meta::CPAN

use lib "$FindBin::Bin/../lib";

use Test::More tests => 105;
use Catalyst::Test 'TestApp';
use Scalar::Util qw/ blessed /;
use Catalyst::Request;
use Catalyst::Request::Upload;
use HTTP::Body::OctetStream;
use HTTP::Headers;
use HTTP::Headers::Util 'split_header_words';
use HTTP::Request::Common;
use Path::Class::Dir;

{
    my $creq;

    my $request = POST(
        'http://localhost/dump/request/',
        'Content-Type' => 'form-data',
        'Content'      => [
            'live_engine_request_cookies.t' =>

t/aggregate/live_engine_response_headers.t  view on Meta::CPAN

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

use Test::More tests => 18;
use Catalyst::Test 'TestApp';
use HTTP::Request::Common;

my $content_length;

foreach my $method (qw(HEAD GET)) {
    my $expected = join( ', ', 1 .. 10 );

    my $request = HTTP::Request::Common->can($method)
        ->( 'http://localhost/engine/response/headers/one' );

    ok( my $response = request($request), 'Request' );
    ok( $response->is_success, 'Response Successful 2xx' );
    is( $response->code, 200, 'Response Code' );
    is( $response->header('X-Catalyst-Action'),
        'engine/response/headers/one', 'Test Action' );
    is( $response->header('X-Header-Catalyst'),
        'Cool', 'Response Header X-Header-Catalyst' );
    is( $response->header('X-Header-Cool'),

t/aggregate/unit_load_catalyst_test.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";
use Catalyst::Utils;
use HTTP::Request::Common;
use Test::Fatal;

my $Class   = 'Catalyst::Test';
my $App     = 'TestApp';
my $Pkg     = __PACKAGE__;
my $Url     = 'http://localhost/';
my $Content = "root index";

my %Meth    = (
    $Pkg    => [qw|get request ctx_request|],          # exported

t/arg_constraints.t  view on Meta::CPAN

use warnings;
use strict;
use HTTP::Request::Common;
use utf8;

BEGIN {
  use Test::More;
  eval "use Type::Tiny 1.000005; 1" || do {
    plan skip_all => "Trouble loading Type::Tiny and friends => $@";
  };
}

BEGIN {

t/bad_warnings.t  view on Meta::CPAN

use warnings;
use strict;
use Test::More;
use HTTP::Request::Common;

# In DEBUG mode, we get not a number warnigs

my $error;

{
  package MyApp::Controller::Root;
  $INC{'MyApp/Controller/Root.pm'} = __FILE__;

  use base 'Catalyst::Controller';

t/body_fh.t  view on Meta::CPAN

use warnings;
use strict;
use Test::More;
use HTTP::Request::Common;
use HTTP::Message::PSGI;
use Plack::Util;

# Test case to check that we now send scalar and filehandle like
# bodys directly to the PSGI engine, rather than call $writer->write
# or unroll the filehandle ourselves.

{
  package MyApp::Controller::Root;

t/configured_comps.t  view on Meta::CPAN

use warnings;
use strict;
use HTTP::Request::Common;
use Test::More;

{
  package TestRole;

  use Moose::Role;

  sub role { 'role' }

  package Local::Model::Foo;

t/consumes.t  view on Meta::CPAN

    my( $self, $c ) = @_;
    my $body = $c->shift_errors;
    $c->res->body( $body || "No errors");
  }

  package MyApp;
  use Catalyst;
  MyApp->setup;
}

use HTTP::Request::Common;
use Catalyst::Test 'MyApp';

{
  # Test to send no post
  ok my $res = request POST 'root/bar',
    'Content-Type' => 'application/json';

  like $res->content, qr"Error Parsing POST 'undef'";
}

t/content_negotiation.t  view on Meta::CPAN

use warnings;
use strict;

use FindBin;
use Test::More;
use HTTP::Request::Common;
use JSON::MaybeXS;

use lib "$FindBin::Bin/lib";
use Catalyst::Test 'TestContentNegotiation';

{
  ok my $req = POST '/',
     Content_Type => 'application/json',
     Content => encode_json +{message=>'test'};

t/data_handler.t  view on Meta::CPAN

use warnings;
use strict;

use FindBin;
use Test::More;
use HTTP::Request::Common;
use JSON::MaybeXS;

use lib "$FindBin::Bin/lib";
use Catalyst::Test 'TestDataHandlers';

ok my($res, $c) = ctx_request('/');

{
  ok my $message = 'helloworld';
  ok my $post = encode_json +{message=>$message};



( run in 0.478 second using v1.01-cache-2.11-cpan-4505f990765 )