Agent-TCLI
view release on metacpan or search on metacpan
t/TCLI.Request.t view on Meta::CPAN
is_deeply($test2->postback,['test@example.com/test','test-master'], '$test2->postback accessor');
# Test args get-set methods
is_deeply($test1->args,['one', 'two', 'three', ], '$test1->get_args get from init args');
ok($test2->args(['one'] ),'$test2->set_args set ');
is_deeply($test2->args,['one'] , '$test2->get_args from set');
# test automethods for args array
is($test1->shift_args,'one', '$test1->shift_args ');
is_deeply($test1->args,[ 'two', 'three', ], '$test1->args after shift');
is($test1->pop_args,'three', '$test1->pop_args ');
is_deeply($test1->args,[ 'two', ], '$test1->args after pop');
ok($test1->unshift_args('one'), '$test1->unshift_args ');
is_deeply($test1->args,['one', 'two', ], '$test1->args after unshift');
ok($test1->push_args('three'), '$test1->push_args ');
is_deeply($test1->args,['one', 'two', 'three', ], '$test1->args after push');
ok($test1->push_args('four'), '$test1->push_args ');
is_deeply($test1->args,['one', 'two', 'three', 'four', ], '$test1->args after push');
is($test1->depth_args,4, '$test1->depth_args ');
# General Automethod tests
ok($test1->set_test('test'),'$test1->set_test');
is($test1->get_test,'test','$test1->get_test');
ok($test1->set_myarray(['one'] ),'$test1->set_myarray autoload ');
is_deeply($test1->get_myarray,['one'] , '$test1->get_myarray autoload');
ok($test1->push_myarray('two','three'), '$test1->push_myarray ');
is_deeply($test1->get_myarray,['one', 'two', 'three', ], '$test1->get_myarray ');
ok($test1->push_myarray('four'), '$test1->push_myarray ');
is_deeply($test1->get_myarray,['one', 'two', 'three', 'four', ], '$test1->get_myarray');
is($test1->depth_myarray,4, '$test1->depth_myarray ');
is($test1->shift_myarray(),'one','$test1->shift_myarray ');
is_deeply($test1->get_myarray,[ 'two', 'three', 'four', ], '$test1->get_myarray');
is($test1->depth_myarray,3, '$test1->depth_myarray ');
is($test1->print_myarray,'two three four', '$test1->print_myarray');
ok($test1->unshift_myarray('one'), '$test1->unshift_myarray ');
is_deeply($test1->get_myarray,['one', 'two', 'three', 'four', ], '$test1->get_myarray');
is($test1->depth_myarray,4, '$test1->depth_myarray ');
#MakeResponse
my $resp2 = $test2->MakeResponse("test", 200);
is_deeply($resp2->sender,['transport_xmpp','transport_test'], '$resp2->sender accessor');
is_deeply($resp2->postback,['test@example.com/test','test-master'], '$resp2->postback accessor');
is($resp2->shift_sender,'transport_xmpp','shift sender');
is($resp2->shift_postback,'test@example.com/test','shift postback');
# Did the original arrays not change.
is_deeply($test2->sender,['transport_xmpp','transport_test'], '$test2->sender accessor');
is_deeply($test2->postback,['test@example.com/test','test-master'], '$test2->postback accessor');
( run in 1.057 second using v1.01-cache-2.11-cpan-39bf76dae61 )