forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-73938 reportbuilder: helper methods for automating report tests.
Implement stress tester methods for iterating over report columns, aggregation and conditions. Assert that each works correctly in isolation, and when used in conjunction with other columns.
- Loading branch information
1 parent
4f94e42
commit 165e26f
Showing
9 changed files
with
233 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
* @copyright 2021 Paul Holden <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class datasource_test extends core_reportbuilder_testcase { | ||
class cohorts_test extends core_reportbuilder_testcase { | ||
|
||
/** | ||
* Test cohorts datasource | ||
|
@@ -132,4 +132,19 @@ public function test_cohorts_datasource_user_select(string $username, string $ex | |
$contentrow = array_values(reset($content)); | ||
$this->assertEquals([$expectedcohort, $username], $contentrow); | ||
} | ||
|
||
/** | ||
* Stress test datasource | ||
*/ | ||
public function test_stress_datasource(): void { | ||
$this->resetAfterTest(); | ||
|
||
$cohort = $this->getDataGenerator()->create_cohort(); | ||
$user = $this->getDataGenerator()->create_user(); | ||
cohort_add_member($cohort->id, $user->id); | ||
|
||
$this->datasource_stress_test_columns(cohorts::class); | ||
$this->datasource_stress_test_columns_aggregation(cohorts::class); | ||
$this->datasource_stress_test_conditions(cohorts::class, 'cohort:name'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters