Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 40... Línea 40...
40
 * @category  test
40
 * @category  test
41
 * @copyright 2009 Tim Hunt
41
 * @copyright 2009 Tim Hunt
42
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
42
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
43
 * @coversDefaultClass \moodle_page
43
 * @coversDefaultClass \moodle_page
44
 */
44
 */
45
class moodle_page_test extends \advanced_testcase {
45
final class moodle_page_test extends \advanced_testcase {
Línea 46... Línea 46...
46
 
46
 
47
    /**
47
    /**
48
     * @var testable_moodle_page
48
     * @var testable_moodle_page
49
     */
49
     */
Línea 332... Línea 332...
332
    /**
332
    /**
333
     * Data provider for {@see test_set_title}.
333
     * Data provider for {@see test_set_title}.
334
     *
334
     *
335
     * @return array
335
     * @return array
336
     */
336
     */
337
    public function set_title_provider(): array {
337
    public static function set_title_provider(): array {
338
        return [
338
        return [
339
            'Do not append the site name' => [
339
            'Do not append the site name' => [
340
                'shortname', false, '', false
340
                'shortname', false, '', false
341
            ],
341
            ],
342
            'Site not yet installed not configured defaults to site shortname' => [
342
            'Site not yet installed not configured defaults to site shortname' => [
Línea 782... Línea 782...
782
     *      'expected' => '',  // Expected value returned by cohort_get_user_cohort_theme.
782
     *      'expected' => '',  // Expected value returned by cohort_get_user_cohort_theme.
783
     *    ]
783
     *    ]
784
     *
784
     *
785
     * @return array
785
     * @return array
786
     */
786
     */
787
    public function get_user_theme_provider() {
787
    public static function get_user_theme_provider(): array {
788
        return [
788
        return [
789
            'User not a member of any cohort' => [
789
            'User not a member of any cohort' => [
790
                'usertheme' => '',
790
                'usertheme' => '',
791
                'sitetheme' => 'boost',
791
                'sitetheme' => 'boost',
792
                'cohorts' => [],
792
                'cohortthemes' => [],
793
                'expected' => 'boost',
793
                'expected' => 'boost',
794
            ],
794
            ],
795
            'User member of one cohort which has a theme set' => [
795
            'User member of one cohort which has a theme set' => [
796
                'usertheme' => '',
796
                'usertheme' => '',
797
                'sitetheme' => 'boost',
797
                'sitetheme' => 'boost',
798
                'cohorts' => [
798
                'cohortthemes' => [
799
                    'classic',
799
                    'classic',
800
                ],
800
                ],
801
                'expected' => 'classic',
801
                'expected' => 'classic',
802
            ],
802
            ],
803
            'User member of one cohort which has a theme set, and one without a theme' => [
803
            'User member of one cohort which has a theme set, and one without a theme' => [
804
                'usertheme' => '',
804
                'usertheme' => '',
805
                'sitetheme' => 'boost',
805
                'sitetheme' => 'boost',
806
                'cohorts' => [
806
                'cohortthemes' => [
807
                    'classic',
807
                    'classic',
808
                    '',
808
                    '',
809
                ],
809
                ],
810
                'expected' => 'classic',
810
                'expected' => 'classic',
811
            ],
811
            ],
812
            'User member of one cohort which has a theme set, and one with a different theme' => [
812
            'User member of one cohort which has a theme set, and one with a different theme' => [
813
                'usertheme' => '',
813
                'usertheme' => '',
814
                'sitetheme' => 'boost',
814
                'sitetheme' => 'boost',
815
                'cohorts' => [
815
                'cohortthemes' => [
816
                    'classic',
816
                    'classic',
817
                    'someother',
817
                    'someother',
818
                ],
818
                ],
819
                'expected' => 'boost',
819
                'expected' => 'boost',
820
            ],
820
            ],
821
            'User with a theme but not a member of any cohort' => [
821
            'User with a theme but not a member of any cohort' => [
822
                'usertheme' => 'classic',
822
                'usertheme' => 'classic',
823
                'sitetheme' => 'boost',
823
                'sitetheme' => 'boost',
824
                'cohorts' => [],
824
                'cohortthemes' => [],
825
                'expected' => 'classic',
825
                'expected' => 'classic',
826
            ],
826
            ],
827
            'User with a theme and member of one cohort which has a theme set' => [
827
            'User with a theme and member of one cohort which has a theme set' => [
828
                'usertheme' => 'classic',
828
                'usertheme' => 'classic',
829
                'sitetheme' => 'boost',
829
                'sitetheme' => 'boost',
830
                'cohorts' => [
830
                'cohortthemes' => [
831
                    'boost',
831
                    'boost',
832
                ],
832
                ],
833
                'expected' => 'classic',
833
                'expected' => 'classic',
834
            ],
834
            ],
835
        ];
835
        ];