Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 36... Línea 36...
36
 *
36
 *
37
 * @package    mod_data
37
 * @package    mod_data
38
 * @copyright  2013 Adrian Greeve
38
 * @copyright  2013 Adrian Greeve
39
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
40
 */
40
 */
41
class lib_test extends \advanced_testcase {
41
final class lib_test extends \advanced_testcase {
Línea 42... Línea 42...
42
 
42
 
43
    /**
43
    /**
44
     * @var moodle_database
44
     * @var moodle_database
45
     */
45
     */
Línea 53... Línea 53...
53
 
53
 
54
        if (isset($this->DB)) {
54
        if (isset($this->DB)) {
55
            $DB = $this->DB;
55
            $DB = $this->DB;
56
            $this->DB = null;
56
            $this->DB = null;
-
 
57
        }
57
        }
58
        parent::tearDown();
Línea 58... Línea 59...
58
    }
59
    }
59
 
60
 
60
    /**
61
    /**
Línea 744... Línea 745...
744
    /**
745
    /**
745
     * Data provider for tests of data_get_config.
746
     * Data provider for tests of data_get_config.
746
     *
747
     *
747
     * @return array
748
     * @return array
748
     */
749
     */
749
    public function data_get_config_provider() {
750
    public static function data_get_config_provider(): array {
750
        $initialdata = (object) [
751
        $initialdata = (object) [
751
            'template_foo' => true,
752
            'template_foo' => true,
752
            'template_bar' => false,
753
            'template_bar' => false,
753
            'template_baz' => null,
754
            'template_baz' => null,
754
        ];
755
        ];
Línea 835... Línea 836...
835
    /**
836
    /**
836
     * Data provider for tests of data_set_config.
837
     * Data provider for tests of data_set_config.
837
     *
838
     *
838
     * @return array
839
     * @return array
839
     */
840
     */
840
    public function data_set_config_provider() {
841
    public static function data_set_config_provider(): array {
841
        $basevalue = (object) ['id' => rand(1, 1000)];
842
        $basevalue = (object) ['id' => rand(1, 1000)];
842
        $config = [
843
        $config = [
843
            'template_foo'  => true,
844
            'template_foo'  => true,
844
            'template_bar'  => false,
845
            'template_bar'  => false,
845
        ];
846
        ];
Línea 2139... Línea 2140...
2139
    /**
2140
    /**
2140
     * Data provider for test_data_append_new_field_to_templates().
2141
     * Data provider for test_data_append_new_field_to_templates().
2141
     *
2142
     *
2142
     * @return array of scenarios
2143
     * @return array of scenarios
2143
     */
2144
     */
2144
    public function data_append_new_field_to_templates_provider(): array {
2145
    public static function data_append_new_field_to_templates_provider(): array {
2145
        return [
2146
        return [
2146
            'Plain template' => [
2147
            'Plain template' => [
2147
                'hasfield' => false,
2148
                'hasfield' => false,
2148
                'hasotherfields' => false,
2149
                'hasotherfields' => false,
2149
                'expected' => true,
2150
                'expected' => true,