Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea 17...
17
declare(strict_types=1);
17
declare(strict_types=1);
Línea 18... Línea 18...
18
 
18
 
19
namespace core_reportbuilder;
19
namespace core_reportbuilder;
20
 
-
 
21
use context_system;
-
 
22
use core_reportbuilder_generator;
-
 
23
use core_reportbuilder_testcase;
20
 
24
use core_user\reportbuilder\datasource\users;
21
use core\context\system;
25
use stdClass;
-
 
-
 
22
use core_reportbuilder_generator;
-
 
23
use core_reportbuilder\local\models\report;
26
use core_reportbuilder\local\models\report;
24
use core_reportbuilder\local\report\base;
27
use core_reportbuilder\local\report\base;
-
 
28
 
25
use core_reportbuilder\exception\{source_invalid_exception, source_unavailable_exception};
29
defined('MOODLE_INTERNAL') || die();
-
 
Línea 30... Línea 26...
30
 
26
use core_reportbuilder\tests\core_reportbuilder_testcase;
31
global $CFG;
27
use core_user\reportbuilder\datasource\users;
32
require_once("{$CFG->dirroot}/reportbuilder/tests/helpers.php");
28
use stdClass;
33
 
29
 
34
/**
30
/**
35
 * Unit tests for the report manager class
31
 * Unit tests for the report manager class
36
 *
32
 *
37
 * @package     core_reportbuilder
33
 * @package     core_reportbuilder
38
 * @covers      \core_reportbuilder\manager
34
 * @covers      \core_reportbuilder\manager
Línea 39... Línea 35...
39
 * @copyright   2020 Paul Holden <paulh@moodle.com>
35
 * @copyright   2020 Paul Holden <paulh@moodle.com>
40
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41
 */
37
 */
42
class manager_test extends core_reportbuilder_testcase {
38
final class manager_test extends core_reportbuilder_testcase {
Línea 170... Línea 166...
170
        ]);
166
        ]);
Línea 171... Línea 167...
171
 
167
 
172
        $this->assertInstanceOf(report::class, $report);
168
        $this->assertInstanceOf(report::class, $report);
173
        $this->assertEquals(base::TYPE_SYSTEM_REPORT, $report->get('type'));
169
        $this->assertEquals(base::TYPE_SYSTEM_REPORT, $report->get('type'));
174
        $this->assertEquals(system_report_available::class, $report->get('source'));
170
        $this->assertEquals(system_report_available::class, $report->get('source'));
175
        $this->assertInstanceOf(context_system::class, $report->get_context());
171
        $this->assertInstanceOf(system::class, $report->get_context());
Línea 176... Línea 172...
176
    }
172
    }
177
 
173
 
178
    /**
174
    /**
179
     * Data provider for {@see test_report_limit_reached}
175
     * Data provider for {@see test_report_limit_reached}
180
     *
176
     *
181
     * @return array
177
     * @return array
182
     */
178
     */
183
    public function report_limit_reached_provider(): array {
179
    public static function report_limit_reached_provider(): array {
184
        return [
180
        return [
185
            [0, 1, false],
181
            [0, 1, false],
186
            [1, 1, true],
182
            [1, 1, true],