Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 56... Línea 56...
56
FUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAO
56
FUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAO
57
w==" alt="This is a bus." />';
57
w==" alt="This is a bus." />';
58
EOF;
58
EOF;
Línea 59... Línea 59...
59
 
59
 
60
 
60
 
Línea 61... Línea 61...
61
    public function test_build_all_accessibilitytools() {
61
    public function test_build_all_accessibilitytools(): void {
62
        $tools = tool::build_all_accessibilitytools();
62
        $tools = tool::build_all_accessibilitytools();
63
 
63
 
64
        $this->assertEquals($tools['errors']::toolshortname(), 'Error list');
64
        $this->assertEquals($tools['errors']::toolshortname(), 'Error list');
65
        $this->assertEquals($tools['activityresults']::toolshortname(), 'Activity breakdown');
65
        $this->assertEquals($tools['activityresults']::toolshortname(), 'Activity breakdown');
66
        $this->assertEquals($tools['checktyperesults']::toolshortname(), 'Content types');
66
        $this->assertEquals($tools['checktyperesults']::toolshortname(), 'Content types');
Línea 67... Línea 67...
67
        $this->assertEquals($tools['printable']::toolshortname(), 'Summary report');
67
        $this->assertEquals($tools['printable']::toolshortname(), 'Summary report');
68
        $this->assertEquals($tools['advanced']::toolshortname(), 'Advanced');
68
        $this->assertEquals($tools['advanced']::toolshortname(), 'Advanced');
69
    }
69
    }
70
 
70
 
71
    public function test_data_is_valid() {
71
    public function test_data_is_valid(): void {
72
        $object = $this->getMockForAbstractClass(tool::class);
72
        $object = $this->getMockForAbstractClass(tool::class);
Línea 73... Línea 73...
73
        $object->set_filter(new filter());
73
        $object->set_filter(new filter());
74
        $output = $object->data_is_valid();
74
        $output = $object->data_is_valid();
75
        $this->assertFalse($output);
75
        $this->assertFalse($output);
76
    }
76
    }
Línea 77... Línea 77...
77
 
77
 
Línea 78... Línea 78...
78
    public function test_can_access() {
78
    public function test_can_access(): void {
79
        $this->resetAfterTest();
79
        $this->resetAfterTest();
80
        $category = $this->getDataGenerator()->create_category();
80
        $category = $this->getDataGenerator()->create_category();
Línea 81... Línea 81...
81
        $filter = new filter(1, $category->id, 'tab', 3, 4);
81
        $filter = new filter(1, $category->id, 'tab', 3, 4);
82
 
82
 
Línea 83... Línea 83...
83
        $tool = $this->getMockForAbstractClass(tool::class);
83
        $tool = $this->getMockForAbstractClass(tool::class);
84
 
84
 
85
        $output = $tool->can_access($filter);
85
        $output = $tool->can_access($filter);
Línea 86... Línea 86...
86
        $this->assertFalse($output);
86
        $this->assertFalse($output);
87
    }
87
    }
88
 
88
 
Línea 89... Línea 89...
89
    public function test_get_error_message() {
89
    public function test_get_error_message(): void {
90
        $tool = $this->getMockForAbstractClass(tool::class);
90
        $tool = $this->getMockForAbstractClass(tool::class);
91
 
91
 
Línea 92... Línea 92...
92
        $output = $tool->get_error_message();
92
        $output = $tool->get_error_message();
93
        $this->assertEquals($output, '');
93
        $this->assertEquals($output, '');
94
    }
94
    }
95
 
95
 
Línea 96... Línea 96...
96
    public function test_get_module_label() {
96
    public function test_get_module_label(): void {
Línea 152... Línea 152...
152
     * Test base 64 image provider.
152
     * Test base 64 image provider.
153
     * @dataProvider base64_img_provider
153
     * @dataProvider base64_img_provider
154
     * @param string $content
154
     * @param string $content
155
     * @param bool $expectation
155
     * @param bool $expectation
156
     */
156
     */
157
    public function test_base64_img_detected(string $content, bool $expectation) {
157
    public function test_base64_img_detected(string $content, bool $expectation): void {
158
        $this->assertEquals(
158
        $this->assertEquals(
159
            $expectation,
159
            $expectation,
160
            tool::base64_img_detected($content)
160
            tool::base64_img_detected($content)
161
        );
161
        );
162
    }
162
    }
Línea 163... Línea 163...
163
 
163
 
164
    public function test_truncate_base64() {
164
    public function test_truncate_base64(): void {
165
        $truncated = tool::truncate_base64($this->base64img);
165
        $truncated = tool::truncate_base64($this->base64img);
166
        $this->assertStringContainsString('<img src="data:image/gif;base64..."', $truncated);
166
        $this->assertStringContainsString('<img src="data:image/gif;base64..."', $truncated);
167
    }
167
    }