Skip to content

Commit

Permalink
MDL-49314 webservices: Fix unit tests for handling hidden activities
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed Apr 1, 2015
1 parent 9cd1093 commit ea2f0e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions completion/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ public function test_get_activities_completion_status() {
$result = external_api::clean_returnvalue(
core_completion_external::get_activities_completion_status_returns(), $result);

// We added 3 activities, but only 2 with completion enabled.
$this->assertCount(2, $result['statuses']);
// We added 4 activities, but only 3 with completion enabled and one of those is hidden.
$this->assertCount(3, $result['statuses']);

// Change teacher role capabilities (disable access al goups).
$context = context_course::instance($course->id);
Expand All @@ -182,8 +182,8 @@ public function test_get_activities_completion_status() {
// We need to execute the return values cleaning process to simulate the web service server.
$result = external_api::clean_returnvalue(
core_completion_external::get_activities_completion_status_returns(), $result);
// We added 3 activities, but only 2 with completion enabled.
$this->assertCount(2, $result['statuses']);
// We added 4 activities, but only 3 with completion enabled and one of those is hidden.
$this->assertCount(3, $result['statuses']);
}

}

0 comments on commit ea2f0e3

Please sign in to comment.