Skip to content

Commit f74b2d8

Browse files
author
Mike Churchward
committed
For 3.10 release, fixing deprecated unit test functions.
1 parent 0d0090c commit f74b2d8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/csvexport_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
class mod_questionnaire_csvexport_test extends advanced_testcase {
3535

36-
public function setUp() {
36+
public function setUp(): void {
3737
global $CFG;
3838

3939
require_once($CFG->dirroot.'/lib/testing/generator/data_generator.php');

tests/lib_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function test_questionnaire_supports() {
5151

5252
public function test_questionnaire_get_extra_capabilities() {
5353
$caps = questionnaire_get_extra_capabilities();
54-
$this->assertInternalType('array', $caps);
54+
$this->assertIsArray($caps);
5555
$this->assertEquals(1, count($caps));
5656
$this->assertEquals('moodle/site:accessallgroups', reset($caps));
5757
}
@@ -231,11 +231,11 @@ public function test_questionnaire_get_user_grades() {
231231

232232
// Test for an array when user specified.
233233
$grades = questionnaire_get_user_grades($questionnaire, $user->id);
234-
$this->assertInternalType('array', $grades);
234+
$this->assertIsArray($grades);
235235

236236
// Test for an array when no user specified.
237237
$grades = questionnaire_get_user_grades($questionnaire);
238-
$this->assertInternalType('array', $grades);
238+
$this->assertIsArray($grades);
239239
}
240240

241241
public function test_questionnaire_update_grades() {

tests/privacy_provider_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class mod_questionnaire_privacy_testcase extends \core_privacy\tests\provider_te
4040
/**
4141
* Tests set up.
4242
*/
43-
public function setUp() {
43+
public function setUp(): void {
4444
$this->resetAfterTest();
4545
$this->setAdminUser();
4646
}
@@ -123,7 +123,7 @@ public function test_export_user_data() {
123123
provider::export_user_data($approvedlist);
124124
$data = $writer->get_data([]);
125125

126-
$this->assertContains($questionnaire->name, strip_tags($data->name));
126+
$this->assertStringContainsString($questionnaire->name, strip_tags($data->name));
127127
$this->assertEquals($questionnaire->intro, strip_tags($data->intro));
128128
$this->assertNotEmpty($data->responses[0]['questions']);
129129
$this->assertEquals('1. Text Box 1000', $data->responses[0]['questions'][1]->questionname);

0 commit comments

Comments
 (0)