TestRail-API-mockOnly.t 707 B

1234567891011121314151617181920
  1. use strict;
  2. use warnings;
  3. #Test things we can only mock, because the API doesn't support them.
  4. use Test::More 'tests' => 2;
  5. use TestRail::API;
  6. use Test::LWP::UserAgent::TestRailMock;
  7. use Scalar::Util qw{reftype};
  8. my $browser = $Test::LWP::UserAgent::TestRailMock::mockObject;
  9. my $tr = TestRail::API->new('http://hokum.bogus','fake','fake',1);
  10. $tr->{'browser'} = $browser;
  11. $tr->{'debug'} = 0;
  12. my $project = $tr->getProjectByName('TestProject');
  13. my $plan = $tr->getPlanByName($project->{'id'},'HooHaaPlan');
  14. my $runs = $tr->getChildRuns($plan);
  15. is(reftype($runs),'ARRAY',"getChildRuns returns array");
  16. is(scalar(@$runs),4,"getChildRuns with multi-configs in the same group returns correct # of runs");