Fix API errors with Testopia 2.0
git-svn-id: svn://10.0.0.236/trunk@246206 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -131,11 +131,12 @@ sub update
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
|
||||
my $result = $environment->update($new_values);
|
||||
|
||||
$environment = new Bugzilla::Testopia::Environment($environment_id);
|
||||
|
||||
$environment->set_name($new_values->{'name'});
|
||||
$environment->set_isactive($new_values->{'isactive'});
|
||||
|
||||
$environment->update();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is modified environment, otherwise an exception will be thrown
|
||||
|
||||
@@ -95,19 +95,20 @@ sub create
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
|
||||
if (not defined $$new_values{plan_id})
|
||||
$self->login;
|
||||
|
||||
my $plan = Bugzilla::Testopia::TestPlan->new($new_values->{plan_id});
|
||||
unless ($plan)
|
||||
{
|
||||
die "Plan ID Number (plan_id) Required When Creating A TestCase"
|
||||
$self->logout;
|
||||
die "Plan ID Number (plan_id) Required When Creating A TestCase";
|
||||
}
|
||||
|
||||
# Plan id linked to new test case after store method is called
|
||||
my $plan_id = $$new_values{plan_id};
|
||||
|
||||
# Remove plan id from new_values hash
|
||||
delete $$new_values{plan_id};
|
||||
|
||||
$self->login;
|
||||
|
||||
|
||||
$new_values->{'plans'} = [$plan];
|
||||
|
||||
my $test_case = Bugzilla::Testopia::TestCase->create($new_values);
|
||||
|
||||
$test_case->link_plan($plan_id, $test_case->id);
|
||||
@@ -176,9 +177,22 @@ sub update
|
||||
die "Update of TestCase's author_id is not allowed";
|
||||
}
|
||||
|
||||
my $result = $test_case->update($new_values);
|
||||
$test_case->set_case_status($new_values->{'case_status_id'});
|
||||
$test_case->set_category($new_values->{'category_id'});
|
||||
$test_case->set_priority($new_values->{'priority_id'});
|
||||
$test_case->set_default_tester($new_values->{'default_tester_id'});
|
||||
$test_case->set_sortkey($new_values->{'sortkey'});
|
||||
$test_case->set_requirement($new_values->{'requirement'});
|
||||
$test_case->set_isautomated($new_values->{'isautomated'});
|
||||
$test_case->set_script($new_values->{'script'});
|
||||
$test_case->set_arguments($new_values->{'arguments'});
|
||||
$test_case->set_summary($new_values->{'summary'});
|
||||
$test_case->set_alias($new_values->{'alias'});
|
||||
$test_case->set_estimated_time($new_values->{'estimated_time'});
|
||||
$test_case->set_dependson($new_values->{'dependson'});
|
||||
$test_case->set_blocks($new_values->{'blocks'});
|
||||
|
||||
$test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
$test_case->update();
|
||||
|
||||
$self->logout;
|
||||
|
||||
|
||||
@@ -130,7 +130,6 @@ sub update
|
||||
}
|
||||
|
||||
$test_plan->set_name(trim($new_values->{'name'}));
|
||||
$test_plan->set_product_id($new_values->{'product_id'});
|
||||
$test_plan->set_default_product_version($new_values->{'default_product_version'});
|
||||
$test_plan->set_type($new_values->{'type_id'});
|
||||
$test_plan->set_isactive($new_values->{'isactive'});
|
||||
|
||||
@@ -128,10 +128,16 @@ sub update
|
||||
die "User Not Authorized";
|
||||
}
|
||||
|
||||
my $result = $test_run->update($new_values);
|
||||
$test_run->set_environment($new_values->{'environment_id'});
|
||||
$test_run->set_build($new_values->{'build_id'});
|
||||
$test_run->set_summary($new_values->{'summary'});
|
||||
$test_run->set_manager($new_values->{'manager_id'});
|
||||
$test_run->set_plan_text_version($new_values->{'plan_text_version'});
|
||||
$test_run->set_notes($new_values->{'notes'});
|
||||
$test_run->set_product_version($new_values->{'product_version'});
|
||||
|
||||
$test_run->update();
|
||||
|
||||
$test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is modified test run on success, otherwise an exception will be thrown
|
||||
|
||||
Reference in New Issue
Block a user