[html-formfu] CatalystX::Controller::ExtJS::REST tests

Mario Minati mario.minati at googlemail.com
Wed Apr 15 21:10:51 GMT 2009


Am Mittwoch 15 April 2009 15:18:18 schrieb Moritz Onken:
> Am 15.04.2009 um 15:06 schrieb Mario Minati:
> > Updated /Catalyst/ and /Test/ but still the same results.
> > Updating more packages now.
> >
> > I'm still useing perl 5.8.8, that shouldn't be a problem, right?
>
> I'm on 5.8.8, too.
>
> We can easily change the test to
>
> $res = $res->previous if $res->previous;
>
> But It'll be interesting why your setup does things differently.

As you said, that's not a solution.

I post the dump of $mech *after* line 23.
What does it look like at your place?

$VAR1 = bless( {
                 'content' => '{"success":1,"data":{"password":"foo","name":"bar","id":null}}',
                 'res' => bless( {
                                   '_protocol' => 'HTTP/1.1',
                                   '_content' => '{"success":1,"data":{"password":"foo","name":"bar","id":null}}',
                                   '_raw_content' => '{"success":1,"data":{"password":"foo","name":"bar","id":null}}',
                                   '_rc' => 201,
                                   '_headers' => bless( {
                                                          'x-catalyst' => '5.71001',
                                                          'content-base' => bless( do{\(my $o = 'http://localhost/user')}, 'URI::http' ),
                                                          'location' => 'http://localhost/user/1',
                                                          'date' => 'Wed, 15 Apr 2009 21:03:06 GMT',
                                                          'status' => '201',
                                                          'vary' => 'Content-Type',
                                                          'content-length' => '62',
                                                          'content-type' => 'application/json'
                                                        }, 'HTTP::Headers' ),
                                   '_msg' => 'Created',
                                   '_request' => bless( {
                                                          '_content' => 'name=bar&password=foo',
                                                          '_uri' => $VAR1->{'res'}{'_headers'}{'content-base'},
                                                          '_headers' => bless( {
                                                                                 'user-agent' => 'Test-WWW-Mechanize/1.24',
                                                                                 'content-type' => 'application/x-www-form-urlencoded',
                                                                                 'accept' => 'application/json',
                                                                                 'accept-encoding' => 'gzip',
                                                                                 'content-length' => 21,
                                                                                 'host' => 'localhost',
                                                                                 'referer' => 'http://localhost/users'
                                                                               }, 'HTTP::Headers' ),
                                                          '_method' => 'POST',
                                                          '_uri_canonical' => $VAR1->{'res'}{'_headers'}{'content-base'}
                                                        }, 'HTTP::Request' )
                                 }, 'HTTP::Response' ),
                 'page_stack' => [
                                   {
                                     'req' => bless( {
                                                       '_content' => '',
                                                       '_uri' => bless( do{\(my $o = 'http://localhost/users')}, 'URI::http' ),
                                                       '_headers' => bless( {
                                                                              'user-agent' => 'Test-WWW-Mechanize/1.24',
                                                                              'accept' => 'application/json',
                                                                              'accept-encoding' => 'gzip',
                                                                              'host' => 'localhost'
                                                                            }, 'HTTP::Headers' ),
                                                       '_method' => 'GET',
                                                       '_uri_canonical' => $VAR1->{'page_stack'}[0]{'req'}{'_uri'}
                                                     }, 'HTTP::Request' ),
                                     'res' => bless( {
                                                       '_protocol' => 'HTTP/1.1',
                                                       '_content' => '{"metaData":{"fields":[{"mapping":"id","name":"id","type":"string"},{"mapping":"password","name":"password","type":"string"},
{"mapping":"name","name":"name","type":"string"}],"totalProperty":"results","root":"rows"},"rows":[],"results":0}',
                                                       '_raw_content' => '{"metaData":{"fields":[{"mapping":"id","name":"id","type":"string"},{"mapping":"password","name":"password","type":"string"},
{"mapping":"name","name":"name","type":"string"}],"totalProperty":"results","root":"rows"},"rows":[],"results":0}',
                                                       '_rc' => 200,
                                                       '_headers' => bless( {
                                                                              'x-catalyst' => '5.71001',
                                                                              'content-type' => 'application/json',
                                                                              'content-base' => $VAR1->{'page_stack'}[0]{'req'}{'_uri'},
                                                                              'date' => 'Wed, 15 Apr 2009 21:03:06 GMT',
                                                                              'status' => '200',
                                                                              'vary' => 'Content-Type',
                                                                              'content-length' => '238'
                                                                            }, 'HTTP::Headers' ),
                                                       '_msg' => 'OK',
                                                       '_request' => $VAR1->{'page_stack'}[0]{'req'}
                                                     }, 'HTTP::Response' )
                                   }
                                 ],
                 'requests_redirectable' => [
                                              'GET',
                                              'HEAD',
                                              'POST'
                                            ],
                 'timeout' => 180,
                 'onerror' => sub { "DUMMY" },
                 'basic_authentication' => {
                                             'localhost:80' => {}
                                           },
                 'links' => [],
                 'base' => bless( do{\(my $o = 'http://localhost/user')}, 'URI::http' ),
                 'images' => [],
                 '_extracted_links' => 0,
                 'show_progress' => undef,
                 'protocols_forbidden' => undef,
                 'no_proxy' => [],
                 'uri' => 'http://localhost/user',
                 '__username' => undef,
                 'protocols_allowed' => undef,
                 'use_eval' => 1,
                 'autocheck' => 0,
                 'def_headers' => bless( {
                                           'user-agent' => 'Test-WWW-Mechanize/1.24'
                                         }, 'HTTP::Headers' ),
                 'proxy' => {},
                 'max_size' => undef,
                 'headers' => {
                                'Accept' => 'application/json'
                              },
                 'req' => $VAR1->{'res'}{'_request'},
                 'allow_external' => 0,
                 'status' => 201,
                 'forms' => [],
                 'ct' => 'application/json',
                 'redirected_uri' => 'http://localhost/user',
                 '_extracted_images' => 0,
                 'catalyst_app' => 'MyApp',
                 'quiet' => 0,
                 'max_redirect' => 7,
                 '__password' => undef,
                 'autolint' => undef,
                 'stack_depth' => 8675309,
                 'handlers' => {
                                 'request_prepare' => bless( [
                                                               {
                                                                 'owner' => 'LWP::UserAgent::cookie_jar',
                                                                 'callback' => sub { "DUMMY" },
                                                                 'line' => '/usr/local/share/perl/5.8.8/LWP/UserAgent.pm:625'
                                                               }
                                                             ], 'HTTP::Config' ),
                                 'response_header' => bless( [
                                                               {
                                                                 'owner' => 'LWP::UserAgent::parse_head',
                                                                 'callback' => sub { "DUMMY" },
                                                                 'm_media_type' => 'html',
                                                                 'line' => '/usr/local/share/perl/5.8.8/LWP/UserAgent.pm:604'
                                                               }
                                                             ], 'HTTP::Config' ),
                                 'response_done' => bless( [
                                                             {
                                                               'owner' => 'LWP::UserAgent::cookie_jar',
                                                               'callback' => sub { "DUMMY" },
                                                               'line' => '/usr/local/share/perl/5.8.8/LWP/UserAgent.pm:628'
                                                             }
                                                           ], 'HTTP::Config' )
                               },
                 'last_uri' => 'http://localhost/user',
                 'onwarn' => sub { "DUMMY" },
                 'cookie_jar' => bless( {
                                          'COOKIES' => {}
                                        }, 'HTTP::Cookies' )
               }, 'Test::WWW::Mechanize::Catalyst' );


Greets,

Mario Minati



More information about the HTML-FormFu mailing list