. declare(strict_types=1); namespace core_user\reportbuilder\datasource; use core_reportbuilder_testcase; defined('MOODLE_INTERNAL') || die(); global $CFG; require_once("{$CFG->dirroot}/reportbuilder/tests/helpers.php"); /** * Unit tests for users datasource * * @package core_user * @covers \core_user\reportbuilder\datasource\users * @copyright 2022 Paul Holden * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class users_test extends core_reportbuilder_testcase { /** * Stress test datasource * * In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php */ public function test_stress_datasource(): void { if (!PHPUNIT_LONGTEST) { $this->markTestSkipped('PHPUNIT_LONGTEST is not defined'); } $this->resetAfterTest(); $this->getDataGenerator()->create_custom_profile_field(['datatype' => 'text', 'name' => 'Hi', 'shortname' => 'hi']); $user = $this->getDataGenerator()->create_user(['profile_field_hi' => 'Hello']); $this->datasource_stress_test_columns(users::class); $this->datasource_stress_test_columns_aggregation(users::class); $this->datasource_stress_test_conditions(users::class, 'user:username'); } }