Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 42... Línea 42...
42
 * @copyright 2013 David Mudrak <david@moodle.com>
42
 * @copyright 2013 David Mudrak <david@moodle.com>
43
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
43
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
44
 */
44
 */
45
class string_manager_standard_test extends \advanced_testcase {
45
class string_manager_standard_test extends \advanced_testcase {
Línea 46... Línea 46...
46
 
46
 
47
    public function test_string_manager_instance() {
47
    public function test_string_manager_instance(): void {
Línea 48... Línea 48...
48
        $this->resetAfterTest();
48
        $this->resetAfterTest();
49
 
49
 
50
        $otherroot = __DIR__.'/fixtures/langtest';
50
        $otherroot = __DIR__.'/fixtures/langtest';
51
        $stringman = testable_core_string_manager::instance($otherroot);
51
        $stringman = testable_core_string_manager::instance($otherroot);
Línea 52... Línea 52...
52
        $this->assertInstanceOf('core_string_manager', $stringman);
52
        $this->assertInstanceOf('core_string_manager', $stringman);
53
    }
53
    }
Línea 54... Línea 54...
54
 
54
 
55
    public function test_get_language_dependencies() {
55
    public function test_get_language_dependencies(): void {
Línea 74... Línea 74...
74
        $this->assertSame(array('bb'), $stringman->get_language_dependencies('bb'));
74
        $this->assertSame(array('bb'), $stringman->get_language_dependencies('bb'));
75
        // Descendant of an orphaned language (N/A < bb < bc).
75
        // Descendant of an orphaned language (N/A < bb < bc).
76
        $this->assertSame(array('bb', 'bc'), $stringman->get_language_dependencies('bc'));
76
        $this->assertSame(array('bb', 'bc'), $stringman->get_language_dependencies('bc'));
77
    }
77
    }
Línea 78... Línea 78...
78
 
78
 
79
    public function test_deprecated_strings() {
79
    public function test_deprecated_strings(): void {
Línea 80... Línea 80...
80
        $stringman = get_string_manager();
80
        $stringman = get_string_manager();
81
 
81
 
Línea 113... Línea 113...
113
     * It will fail if the string in the wrong format or non-existing (mistyped) string was deprecated.
113
     * It will fail if the string in the wrong format or non-existing (mistyped) string was deprecated.
114
     *
114
     *
115
     * @dataProvider get_deprecated_strings_provider
115
     * @dataProvider get_deprecated_strings_provider
116
     * @param   string      $string     The string to be tested
116
     * @param   string      $string     The string to be tested
117
     */
117
     */
118
    public function test_validate_deprecated_strings_files($string) {
118
    public function test_validate_deprecated_strings_files($string): void {
119
        $stringman = get_string_manager();
119
        $stringman = get_string_manager();
Línea 120... Línea 120...
120
 
120
 
121
        $result = preg_match('/^(.*),(.*)$/', $string, $matches);
121
        $result = preg_match('/^(.*),(.*)$/', $string, $matches);
122
        $this->assertEquals(1, $result);
122
        $this->assertEquals(1, $result);
Línea 134... Línea 134...
134
    }
134
    }
Línea 135... Línea 135...
135
 
135
 
136
    /**
136
    /**
137
     * Test for $CFG->langlist (without installation of additional languages)
137
     * Test for $CFG->langlist (without installation of additional languages)
138
     */
138
     */
139
    public function test_get_list_of_translations() {
139
    public function test_get_list_of_translations(): void {
140
        $this->resetAfterTest();
140
        $this->resetAfterTest();
Línea 141... Línea 141...
141
        $stringman = get_string_manager();
141
        $stringman = get_string_manager();
Línea 160... Línea 160...
160
    }
160
    }
Línea 161... Línea 161...
161
 
161
 
162
    /**
162
    /**
163
     * Test {@see core_string_manager_standard::get_list_of_countries()} under different conditions.
163
     * Test {@see core_string_manager_standard::get_list_of_countries()} under different conditions.
164
     */
164
     */
Línea 165... Línea 165...
165
    public function test_get_list_of_countries() {
165
    public function test_get_list_of_countries(): void {
166
 
166
 
Línea 167... Línea 167...
167
        $this->resetAfterTest();
167
        $this->resetAfterTest();