Skip to content

Commit

Permalink
Duplicated test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jul 10, 2023
1 parent 17e9aef commit 0f2ec16
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions tests/coursecattoolbox_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function test_search_all_courses_pages() {
$this->set_up();
$this->add_more_courses();
$perpage = 3;
$offset = 2 * $perpage;
$offset = 3 * $perpage;
$searchresults = $this->toolbox->search_courses('', array('offset' => $offset, 'limit' => $perpage))['courses'];
$expectedresults = array(
'TP1' => 'Topic One',
Expand All @@ -297,16 +297,6 @@ public function test_search_all_courses_pages() {
'TP35' => 'Three Five'
);

$this->assertEquals(3, count($searchresults));
$expectedresultcount = 0;
foreach ($searchresults as $courseinlistobject) {
$this->assertEquals($courseinlistobject->fullname, $expectedresults[$courseinlistobject->shortname]);
$expectedresultcount++;
}
$this->assertEquals(3, $expectedresultcount);

$offset = 3 * $perpage;
$searchresults = $this->toolbox->search_courses('', array('offset' => $offset, 'limit' => $perpage))['courses'];
$this->assertEquals(1, count($searchresults));
$expectedresultcount = 0;
foreach ($searchresults as $courseinlistobject) {
Expand Down

0 comments on commit 0f2ec16

Please sign in to comment.