diff --git a/auth/tests/privacy/provider_test.php b/auth/tests/privacy/provider_test.php index 6e041552087..469acfe6ba9 100644 --- a/auth/tests/privacy/provider_test.php +++ b/auth/tests/privacy/provider_test.php @@ -94,11 +94,11 @@ class provider_test extends provider_testcase { $prefs = writer::with_context($sysctx)->get_user_preferences('core_auth'); $this->assertEquals(transform::yesno(false), $prefs->auth_forcepasswordchange->value); $this->assertEquals(transform::yesno(false), $prefs->create_password->value); - $this->assertObjectNotHasAttribute('login_failed_count', $prefs); - $this->assertObjectNotHasAttribute('login_failed_count_since_success', $prefs); - $this->assertObjectNotHasAttribute('login_failed_last', $prefs); - $this->assertObjectNotHasAttribute('login_lockout', $prefs); + $this->assertObjectNotHasProperty('login_failed_count', $prefs); + $this->assertObjectNotHasProperty('login_failed_count_since_success', $prefs); + $this->assertObjectNotHasProperty('login_failed_last', $prefs); + $this->assertObjectNotHasProperty('login_lockout', $prefs); $this->assertEquals(transform::yesno(true), $prefs->login_lockout_ignored->value); - $this->assertObjectNotHasAttribute('login_lockout_secret', $prefs); + $this->assertObjectNotHasProperty('login_lockout_secret', $prefs); } } diff --git a/blocks/tests/privacy/provider_test.php b/blocks/tests/privacy/provider_test.php index eb6bcf1618e..6438ccc081c 100644 --- a/blocks/tests/privacy/provider_test.php +++ b/blocks/tests/privacy/provider_test.php @@ -381,12 +381,12 @@ class provider_test extends provider_testcase { $this->assertEquals($yes, $prefs->block_is_hidden->value); $prefs = writer::with_context($bprivatefiles->context)->get_user_context_preferences('core_block'); - $this->assertObjectNotHasAttribute('block_is_docked', $prefs); + $this->assertObjectNotHasProperty('block_is_docked', $prefs); $this->assertEquals($no, $prefs->block_is_hidden->value); $prefs = writer::with_context($bmyprofile->context)->get_user_context_preferences('core_block'); $this->assertEquals($yes, $prefs->block_is_docked->value); - $this->assertObjectNotHasAttribute('block_is_hidden', $prefs); + $this->assertObjectNotHasProperty('block_is_hidden', $prefs); } /** diff --git a/cohort/tests/lib_test.php b/cohort/tests/lib_test.php index 8bf48250d1c..7d3cbfbbe5f 100644 --- a/cohort/tests/lib_test.php +++ b/cohort/tests/lib_test.php @@ -720,7 +720,7 @@ class lib_test extends \advanced_testcase { // Test custom fields are not returned if not needed. $result = cohort_get_cohort($cohort1->id, $coursectx); - $this->assertObjectNotHasAttribute('customfields', $result); + $this->assertObjectNotHasProperty('customfields', $result); // Test cohort_get_cohorts. $result = cohort_get_cohorts(\context_system::instance()->id, 0, 25, '', true); @@ -745,7 +745,7 @@ class lib_test extends \advanced_testcase { $this->assertEquals(2, $result['totalcohorts']); $this->assertEquals(2, $result['allcohorts']); foreach ($result['cohorts'] as $cohort) { - $this->assertObjectNotHasAttribute('customfields', $cohort); + $this->assertObjectNotHasProperty('customfields', $cohort); } // Test test_cohort_get_all_cohorts. @@ -771,7 +771,7 @@ class lib_test extends \advanced_testcase { $this->assertEquals(2, $result['totalcohorts']); $this->assertEquals(2, $result['allcohorts']); foreach ($result['cohorts'] as $cohort) { - $this->assertObjectNotHasAttribute('customfields', $cohort); + $this->assertObjectNotHasProperty('customfields', $cohort); } // Test cohort_get_available_cohorts. @@ -795,7 +795,7 @@ class lib_test extends \advanced_testcase { $result = cohort_get_available_cohorts($coursectx, COHORT_ALL, 0, 25, ''); $this->assertCount(2, $result); foreach ($result as $cohort) { - $this->assertObjectNotHasAttribute('customfields', $cohort); + $this->assertObjectNotHasProperty('customfields', $cohort); } // Test cohort_get_user_cohorts. @@ -822,7 +822,7 @@ class lib_test extends \advanced_testcase { $result = cohort_get_user_cohorts($user->id); $this->assertCount(2, $result); foreach ($result as $cohort) { - $this->assertObjectNotHasAttribute('customfields', $cohort); + $this->assertObjectNotHasProperty('customfields', $cohort); } } diff --git a/course/format/tests/external/update_course_test.php b/course/format/tests/external/update_course_test.php index 56d64f889bd..754b355cafb 100644 --- a/course/format/tests/external/update_course_test.php +++ b/course/format/tests/external/update_course_test.php @@ -93,7 +93,7 @@ class update_course_test extends \externallib_advanced_testcase { $update = $this->find_update($results, $expected['action'], 'cm', $activity->cmid); $this->assertNotEmpty($update); if ($expected['visible'] === null) { - $this->assertObjectNotHasAttribute('visible', $update->fields); + $this->assertObjectNotHasProperty('visible', $update->fields); } else { $this->assertEquals($expected['visible'], $update->fields->visible); } diff --git a/course/format/tests/output/activitybadge_test.php b/course/format/tests/output/activitybadge_test.php index 98f2dfe3fdd..b20e955b24b 100644 --- a/course/format/tests/output/activitybadge_test.php +++ b/course/format/tests/output/activitybadge_test.php @@ -176,31 +176,31 @@ class activitybadge_test extends \advanced_testcase { ?array $extra = null ): void { if (is_null($content)) { - $this->assertObjectNotHasAttribute('badgecontent', $result); + $this->assertObjectNotHasProperty('badgecontent', $result); } else { $this->assertEquals($content, $result->badgecontent); } if (is_null($style)) { - $this->assertObjectNotHasAttribute('badgestyle', $result); + $this->assertObjectNotHasProperty('badgestyle', $result); } else { $this->assertEquals($style, $result->badgestyle); } if (is_null($url)) { - $this->assertObjectNotHasAttribute('badgeurl', $result); + $this->assertObjectNotHasProperty('badgeurl', $result); } else { $this->assertEquals($url, $result->badgeurl); } if (is_null($elementid)) { - $this->assertObjectNotHasAttribute('badgeelementid', $result); + $this->assertObjectNotHasProperty('badgeelementid', $result); } else { $this->assertEquals($elementid, $result->badgeelementid); } if (is_null($extra)) { - $this->assertObjectNotHasAttribute('badgeextraattributes', $result); + $this->assertObjectNotHasProperty('badgeextraattributes', $result); } else { $this->assertEquals($extra, $result->badgeextraattributes); } diff --git a/enrol/lti/tests/local/ltiadvantage/service/tool_launch_service_test.php b/enrol/lti/tests/local/ltiadvantage/service/tool_launch_service_test.php index 6558e44ec43..c2239b20c01 100644 --- a/enrol/lti/tests/local/ltiadvantage/service/tool_launch_service_test.php +++ b/enrol/lti/tests/local/ltiadvantage/service/tool_launch_service_test.php @@ -514,7 +514,7 @@ class tool_launch_service_test extends \lti_advantage_testcase { // Instructors aren't subject to forceembed. $launchservice->user_launches_tool($instructoruser, $mockinstructorlaunch); - $this->assertObjectNotHasAttribute('forcepagelayout', $SESSION); + $this->assertObjectNotHasProperty('forcepagelayout', $SESSION); // Learners are. $launchservice->user_launches_tool($learneruser, $mocklearnerlaunch); diff --git a/enrol/tests/course_enrolment_manager_test.php b/enrol/tests/course_enrolment_manager_test.php index 01fb9a6b983..70c4bf36c7b 100644 --- a/enrol/tests/course_enrolment_manager_test.php +++ b/enrol/tests/course_enrolment_manager_test.php @@ -296,7 +296,7 @@ class course_enrolment_manager_test extends \advanced_testcase { $this->assertEquals('Smart suit', $user->imagealt); // But not some random other field like city. - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('city', $user); } /** @@ -330,7 +330,7 @@ class course_enrolment_manager_test extends \advanced_testcase { $this->assertEquals('Smart suit', $user->imagealt); // But not some random other field like city. - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('city', $user); } /** @@ -367,7 +367,7 @@ class course_enrolment_manager_test extends \advanced_testcase { $this->assertEquals('Smart suit', $user->imagealt); // But not some random other field like city. - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('city', $user); } /** diff --git a/enrol/tests/enrollib_test.php b/enrol/tests/enrollib_test.php index f394ddca05e..fdf834f8004 100644 --- a/enrol/tests/enrollib_test.php +++ b/enrol/tests/enrollib_test.php @@ -954,14 +954,14 @@ class enrollib_test extends advanced_testcase { // Check fields parameter still works. Fields default (certain base fields). $this->assertObjectHasAttribute('id', $courses[$course3->id]); $this->assertObjectHasAttribute('shortname', $courses[$course3->id]); - $this->assertObjectNotHasAttribute('summary', $courses[$course3->id]); + $this->assertObjectNotHasProperty('summary', $courses[$course3->id]); // Specified fields (one, string). $courses = enrol_get_my_courses('summary', 'id', 0, [], true); $this->assertObjectHasAttribute('id', $courses[$course3->id]); $this->assertObjectHasAttribute('shortname', $courses[$course3->id]); $this->assertObjectHasAttribute('summary', $courses[$course3->id]); - $this->assertObjectNotHasAttribute('summaryformat', $courses[$course3->id]); + $this->assertObjectNotHasProperty('summaryformat', $courses[$course3->id]); // Specified fields (two, string). $courses = enrol_get_my_courses('summary, summaryformat', 'id', 0, [], true); diff --git a/lib/phpunit/tests/advanced_test.php b/lib/phpunit/tests/advanced_test.php index 6aa4ba18ccb..e9dc00d6ba6 100644 --- a/lib/phpunit/tests/advanced_test.php +++ b/lib/phpunit/tests/advanced_test.php @@ -120,7 +120,7 @@ class advanced_test extends \advanced_testcase { // Ensure session is reset after setUser, as it may contain extra info. $SESSION->sometestvalue = true; $this->setUser($user); - $this->assertObjectNotHasAttribute('sometestvalue', $SESSION); + $this->assertObjectNotHasProperty('sometestvalue', $SESSION); } public function test_set_admin_user() { diff --git a/lib/tests/cron_test.php b/lib/tests/cron_test.php index b8760a3f4ed..cc2673da217 100644 --- a/lib/tests/cron_test.php +++ b/lib/tests/cron_test.php @@ -76,7 +76,7 @@ class cron_test extends \advanced_testcase { $this->assertSame($user1->id, $USER->id); $this->assertSame($PAGE->context, \context_course::instance($SITE->id)); $this->assertNotSame($adminsession, $SESSION); - $this->assertObjectNotHasAttribute('test1', $SESSION); + $this->assertObjectNotHasProperty('test1', $SESSION); $this->assertEmpty((array)$SESSION); $usersession1 = $SESSION; $SESSION->test2 = true; diff --git a/lib/tests/datalib_test.php b/lib/tests/datalib_test.php index 134176da19c..09a99f43bd3 100644 --- a/lib/tests/datalib_test.php +++ b/lib/tests/datalib_test.php @@ -418,7 +418,7 @@ class datalib_test extends \advanced_testcase { $this->assertSame('folder', $cm->modname); $this->assertSame($folder1a->id, $cm->instance); $this->assertSame($folder1a->course, $cm->course); - $this->assertObjectNotHasAttribute('sectionnum', $cm); + $this->assertObjectNotHasProperty('sectionnum', $cm); $this->assertEquals($cm, get_coursemodule_from_id('', $folder1a->cmid)); $this->assertEquals($cm, get_coursemodule_from_id('folder', $folder1a->cmid, $course1->id)); @@ -483,7 +483,7 @@ class datalib_test extends \advanced_testcase { $this->assertSame('folder', $cm->modname); $this->assertSame($folder1a->id, $cm->instance); $this->assertSame($folder1a->course, $cm->course); - $this->assertObjectNotHasAttribute('sectionnum', $cm); + $this->assertObjectNotHasProperty('sectionnum', $cm); $this->assertEquals($cm, get_coursemodule_from_instance('folder', $folder1a->id, $course1->id)); $this->assertEquals($cm, get_coursemodule_from_instance('folder', $folder1a->id, 0)); @@ -553,17 +553,17 @@ class datalib_test extends \advanced_testcase { $this->assertSame('folder', $cm->modname); $this->assertSame($folder1a->id, $cm->instance); $this->assertSame($folder1a->course, $cm->course); - $this->assertObjectNotHasAttribute('sectionnum', $cm); - $this->assertObjectNotHasAttribute('revision', $cm); - $this->assertObjectNotHasAttribute('display', $cm); + $this->assertObjectNotHasProperty('sectionnum', $cm); + $this->assertObjectNotHasProperty('revision', $cm); + $this->assertObjectNotHasProperty('display', $cm); $cm = $modules[$folder1b->cmid]; $this->assertSame('folder', $cm->modname); $this->assertSame($folder1b->id, $cm->instance); $this->assertSame($folder1b->course, $cm->course); - $this->assertObjectNotHasAttribute('sectionnum', $cm); - $this->assertObjectNotHasAttribute('revision', $cm); - $this->assertObjectNotHasAttribute('display', $cm); + $this->assertObjectNotHasProperty('sectionnum', $cm); + $this->assertObjectNotHasProperty('revision', $cm); + $this->assertObjectNotHasProperty('display', $cm); $modules = get_coursemodules_in_course('folder', $course1->id, 'revision, display'); $this->assertCount(2, $modules); @@ -572,7 +572,7 @@ class datalib_test extends \advanced_testcase { $this->assertSame('folder', $cm->modname); $this->assertSame($folder1a->id, $cm->instance); $this->assertSame($folder1a->course, $cm->course); - $this->assertObjectNotHasAttribute('sectionnum', $cm); + $this->assertObjectNotHasProperty('sectionnum', $cm); $this->assertObjectHasAttribute('revision', $cm); $this->assertObjectHasAttribute('display', $cm); @@ -845,8 +845,8 @@ class datalib_test extends \advanced_testcase { $this->assertObjectHasAttribute('firstnamephonetic', $results[$userids[0]]); // Should not have the custom field or department because no context specified. - $this->assertObjectNotHasAttribute('department', $results[$userids[0]]); - $this->assertObjectNotHasAttribute('profile_field_specialid', $results[$userids[0]]); + $this->assertObjectNotHasProperty('department', $results[$userids[0]]); + $this->assertObjectNotHasProperty('profile_field_specialid', $results[$userids[0]]); // Check sorting. $results = get_users_listing('username', 'DESC'); @@ -867,8 +867,8 @@ class datalib_test extends \advanced_testcase { // specify a context AND have permissions. $results = get_users_listing('lastaccess', 'asc', 0, 0, '', '', '', '', null, \context_system::instance()); - $this->assertObjectNotHasAttribute('department', $results[$userids[0]]); - $this->assertObjectNotHasAttribute('profile_field_specialid', $results[$userids[0]]); + $this->assertObjectNotHasProperty('department', $results[$userids[0]]); + $this->assertObjectNotHasProperty('profile_field_specialid', $results[$userids[0]]); $this->setAdminUser(); $results = get_users_listing('lastaccess', 'asc', 0, 0, '', '', '', '', null, \context_system::instance()); diff --git a/lib/tests/filetypes_test.php b/lib/tests/filetypes_test.php index 478de231f16..0318bc7f671 100644 --- a/lib/tests/filetypes_test.php +++ b/lib/tests/filetypes_test.php @@ -214,36 +214,36 @@ class filetypes_test extends \advanced_testcase { $this->resetAfterTest(); // The custom filetypes setting is empty to start with. - $this->assertObjectNotHasAttribute('customfiletypes', $CFG); + $this->assertObjectNotHasProperty('customfiletypes', $CFG); // Add a custom filetype, then delete it. core_filetypes::add_type('frog', 'application/x-frog', 'document'); $this->assertObjectHasAttribute('customfiletypes', $CFG); core_filetypes::delete_type('frog'); - $this->assertObjectNotHasAttribute('customfiletypes', $CFG); + $this->assertObjectNotHasProperty('customfiletypes', $CFG); // Change a standard filetype, then change it back. core_filetypes::update_type('asm', 'asm', 'text/plain', 'document'); $this->assertObjectHasAttribute('customfiletypes', $CFG); core_filetypes::update_type('asm', 'asm', 'text/plain', 'sourcecode'); - $this->assertObjectNotHasAttribute('customfiletypes', $CFG); + $this->assertObjectNotHasProperty('customfiletypes', $CFG); // Delete a standard filetype, then add it back (the same). core_filetypes::delete_type('asm'); $this->assertObjectHasAttribute('customfiletypes', $CFG); core_filetypes::add_type('asm', 'text/plain', 'sourcecode'); - $this->assertObjectNotHasAttribute('customfiletypes', $CFG); + $this->assertObjectNotHasProperty('customfiletypes', $CFG); // Revert a changed type. core_filetypes::update_type('asm', 'asm', 'text/plain', 'document'); $this->assertObjectHasAttribute('customfiletypes', $CFG); core_filetypes::revert_type_to_default('asm'); - $this->assertObjectNotHasAttribute('customfiletypes', $CFG); + $this->assertObjectNotHasProperty('customfiletypes', $CFG); // Revert a deleted type. core_filetypes::delete_type('asm'); $this->assertObjectHasAttribute('customfiletypes', $CFG); core_filetypes::revert_type_to_default('asm'); - $this->assertObjectNotHasAttribute('customfiletypes', $CFG); + $this->assertObjectNotHasProperty('customfiletypes', $CFG); } } diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index 1b277bb9e82..30558930d6d 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -3159,8 +3159,8 @@ EOF; $this->assertTimeCurrent($USER->currentlogin); $this->assertSame(sesskey(), $USER->sesskey); $this->assertTimeCurrent($USER->preference['_lastloaded']); - $this->assertObjectNotHasAttribute('password', $USER); - $this->assertObjectNotHasAttribute('description', $USER); + $this->assertObjectNotHasProperty('password', $USER); + $this->assertObjectNotHasProperty('description', $USER); } /** diff --git a/lib/tests/session_manager_test.php b/lib/tests/session_manager_test.php index 34239875caa..5b74958907d 100644 --- a/lib/tests/session_manager_test.php +++ b/lib/tests/session_manager_test.php @@ -105,8 +105,8 @@ class session_manager_test extends \advanced_testcase { \core\session\manager::set_user($user); $this->assertEquals($user->id, $USER->id); - $this->assertObjectNotHasAttribute('description', $user); - $this->assertObjectNotHasAttribute('password', $user); + $this->assertObjectNotHasProperty('description', $user); + $this->assertObjectNotHasProperty('password', $user); $this->assertObjectHasAttribute('sesskey', $user); $this->assertSame($user, $GLOBALS['USER']); $this->assertSame($GLOBALS['USER'], $_SESSION['USER']); @@ -124,8 +124,8 @@ class session_manager_test extends \advanced_testcase { @\core\session\manager::login_user($user); // Ignore header error messages. $this->assertEquals($user->id, $USER->id); - $this->assertObjectNotHasAttribute('description', $user); - $this->assertObjectNotHasAttribute('password', $user); + $this->assertObjectNotHasProperty('description', $user); + $this->assertObjectNotHasProperty('password', $user); $this->assertSame($user, $GLOBALS['USER']); $this->assertSame($GLOBALS['USER'], $_SESSION['USER']); $this->assertSame($GLOBALS['USER'], $USER); @@ -558,7 +558,7 @@ class session_manager_test extends \advanced_testcase { $_SESSION['extra'] = true; // Try admin loginas this user in system context. - $this->assertObjectNotHasAttribute('realuser', $USER); + $this->assertObjectNotHasProperty('realuser', $USER); \core\session\manager::loginas($user->id, \context_system::instance()); $this->assertSame($user->id, $USER->id); diff --git a/lib/tests/sessionlib_test.php b/lib/tests/sessionlib_test.php index f4e40ce08ae..aa801ee37d9 100644 --- a/lib/tests/sessionlib_test.php +++ b/lib/tests/sessionlib_test.php @@ -76,7 +76,7 @@ class sessionlib_test extends \advanced_testcase { $this->assertSame($user1->id, $USER->id); $this->assertSame($PAGE->context, \context_course::instance($SITE->id)); $this->assertNotSame($adminsession, $SESSION); - $this->assertObjectNotHasAttribute('test1', $SESSION); + $this->assertObjectNotHasProperty('test1', $SESSION); $this->assertEmpty((array)$SESSION); $usersession1 = $SESSION; $SESSION->test2 = true; @@ -261,7 +261,7 @@ class sessionlib_test extends \advanced_testcase { $user = $this->getDataGenerator()->create_user(); \core\session\manager::init_empty_session(); - $this->assertObjectNotHasAttribute('sesskey', $USER); + $this->assertObjectNotHasProperty('sesskey', $USER); $sesskey = sesskey(); $this->assertNotEmpty($sesskey); diff --git a/lib/tests/upgradelib_test.php b/lib/tests/upgradelib_test.php index 4b56c8507c1..534c19fc24a 100644 --- a/lib/tests/upgradelib_test.php +++ b/lib/tests/upgradelib_test.php @@ -1568,7 +1568,7 @@ calendar,core_calendar|/calendar/view.php?view=month', public function test_moodle_start_upgrade_outageless() { global $CFG; $this->resetAfterTest(); - $this->assertObjectNotHasAttribute('upgraderunning', $CFG); + $this->assertObjectNotHasProperty('upgraderunning', $CFG); // Confirm that starting normally sets the upgraderunning flag. upgrade_started(); @@ -1592,7 +1592,7 @@ calendar,core_calendar|/calendar/view.php?view=month', public function test_moodle_set_upgrade_timeout_outageless() { global $CFG; $this->resetAfterTest(); - $this->assertObjectNotHasAttribute('upgraderunning', $CFG); + $this->assertObjectNotHasProperty('upgraderunning', $CFG); // Confirm running normally sets the timeout. upgrade_set_timeout(120); diff --git a/lib/xapi/tests/local/statement_test.php b/lib/xapi/tests/local/statement_test.php index c9ff7be7aef..2bd1c6dd3ec 100644 --- a/lib/xapi/tests/local/statement_test.php +++ b/lib/xapi/tests/local/statement_test.php @@ -174,7 +174,7 @@ class statement_test extends advanced_testcase { $this->assertObjectHasAttribute($extra, $data); $this->assertNotEmpty($data->$extra); } else { - $this->assertObjectNotHasAttribute($extra, $data); + $this->assertObjectNotHasProperty($extra, $data); } } } @@ -308,7 +308,7 @@ class statement_test extends advanced_testcase { $this->assertObjectHasAttribute($extra, $data); $this->assertNotEmpty($data->object); } else { - $this->assertObjectNotHasAttribute($extra, $data); + $this->assertObjectNotHasProperty($extra, $data); } } } diff --git a/message/tests/api_test.php b/message/tests/api_test.php index 1d6496e898b..cda46271886 100644 --- a/message/tests/api_test.php +++ b/message/tests/api_test.php @@ -5209,7 +5209,7 @@ class api_test extends messagelib_test { $this->assertCount(1, (array) $customdata->actionbuttons); $this->assertObjectHasAttribute('placeholders', $customdata); $this->assertCount(1, (array) $customdata->placeholders); - $this->assertObjectNotHasAttribute('notificationiconurl', $customdata); // No group image means no image. + $this->assertObjectNotHasProperty('notificationiconurl', $customdata); // No group image means no image. // Verify events. Note: the event is a message read event because of an if (PHPUNIT) conditional within message_send(), // however, we can still determine the number and ids of any recipients this way. diff --git a/reportbuilder/tests/external/custom_report_exporter_test.php b/reportbuilder/tests/external/custom_report_exporter_test.php index 297db31ddb0..6256826a7dd 100644 --- a/reportbuilder/tests/external/custom_report_exporter_test.php +++ b/reportbuilder/tests/external/custom_report_exporter_test.php @@ -98,11 +98,11 @@ class custom_report_exporter_test extends advanced_testcase { ], $export->attributes); // The following are all generated by additional exporters, and should not be present when not editing. - $this->assertObjectNotHasAttribute('sidebarmenucards', $export); - $this->assertObjectNotHasAttribute('conditions', $export); - $this->assertObjectNotHasAttribute('filters', $export); - $this->assertObjectNotHasAttribute('sorting', $export); - $this->assertObjectNotHasAttribute('cardview', $export); + $this->assertObjectNotHasProperty('sidebarmenucards', $export); + $this->assertObjectNotHasProperty('conditions', $export); + $this->assertObjectNotHasProperty('filters', $export); + $this->assertObjectNotHasProperty('sorting', $export); + $this->assertObjectNotHasProperty('cardview', $export); } /** diff --git a/user/tests/fields_test.php b/user/tests/fields_test.php index 1d7977be335..7ca822beebc 100644 --- a/user/tests/fields_test.php +++ b/user/tests/fields_test.php @@ -391,7 +391,7 @@ class fields_test extends \advanced_testcase { $this->assertCount(2, $records); // User id was renamed. - $this->assertObjectNotHasAttribute('id', $records['XXX1']); + $this->assertObjectNotHasProperty('id', $records['XXX1']); $this->assertObjectHasAttribute('userid', $records['XXX1']); // Other fields are normal (just try a couple). @@ -415,8 +415,8 @@ class fields_test extends \advanced_testcase { $this->assertCount(2, $records); // User id was renamed. - $this->assertObjectNotHasAttribute('id', $records['XXX1']); - $this->assertObjectNotHasAttribute('u_id', $records['XXX1']); + $this->assertObjectNotHasProperty('id', $records['XXX1']); + $this->assertObjectNotHasProperty('u_id', $records['XXX1']); $this->assertObjectHasAttribute('userid', $records['XXX1']); // Other fields are prefixed (just try a couple). diff --git a/user/tests/profilelib_test.php b/user/tests/profilelib_test.php index e8609d71056..dc8b1bbd20a 100644 --- a/user/tests/profilelib_test.php +++ b/user/tests/profilelib_test.php @@ -56,7 +56,7 @@ class profilelib_test extends \advanced_testcase { $this->assertArrayNotHasKey($id1, profile_get_custom_fields(true)); // Check that profile_user_record returns same (no) fields. - $this->assertObjectNotHasAttribute('frogdesc', profile_user_record($user->id)); + $this->assertObjectNotHasProperty('frogdesc', profile_user_record($user->id)); // Check that profile_user_record returns all the fields when requested. $this->assertObjectHasAttribute('frogdesc', profile_user_record($user->id, false)); diff --git a/user/tests/userselector_test.php b/user/tests/userselector_test.php index 2cdf60d7714..81b510d380e 100644 --- a/user/tests/userselector_test.php +++ b/user/tests/userselector_test.php @@ -75,9 +75,9 @@ class userselector_test extends \advanced_testcase { foreach ($selector->find_users('') as $found) { foreach ($found as $user) { - $this->assertObjectNotHasAttribute('idnumber', $user); - $this->assertObjectNotHasAttribute('country', $user); - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('idnumber', $user); + $this->assertObjectNotHasProperty('country', $user); + $this->assertObjectNotHasProperty('city', $user); } } } @@ -95,9 +95,9 @@ class userselector_test extends \advanced_testcase { foreach ($systemselector->find_users('') as $found) { foreach ($found as $user) { - $this->assertObjectNotHasAttribute('idnumber', $user); - $this->assertObjectNotHasAttribute('country', $user); - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('idnumber', $user); + $this->assertObjectNotHasProperty('country', $user); + $this->assertObjectNotHasProperty('city', $user); } } @@ -125,8 +125,8 @@ class userselector_test extends \advanced_testcase { foreach ($courseselector->find_users('') as $found) { foreach ($found as $user) { $this->assertObjectHasAttribute('idnumber', $user); - $this->assertObjectNotHasAttribute('country', $user); - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('country', $user); + $this->assertObjectNotHasProperty('city', $user); } } } @@ -179,8 +179,8 @@ class userselector_test extends \advanced_testcase { foreach ($systemselector->find_users('') as $found) { foreach ($found as $user) { $this->assertObjectHasAttribute('idnumber', $user); - $this->assertObjectNotHasAttribute('country', $user); - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('country', $user); + $this->assertObjectNotHasProperty('city', $user); } } @@ -210,16 +210,16 @@ class userselector_test extends \advanced_testcase { foreach ($systemselector->find_users('') as $found) { foreach ($found as $user) { $this->assertObjectHasAttribute('idnumber', $user); - $this->assertObjectNotHasAttribute('country', $user); - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('country', $user); + $this->assertObjectNotHasProperty('city', $user); } } foreach ($courseselector->find_users('') as $found) { foreach ($found as $user) { $this->assertObjectHasAttribute('idnumber', $user); - $this->assertObjectNotHasAttribute('country', $user); - $this->assertObjectNotHasAttribute('city', $user); + $this->assertObjectNotHasProperty('country', $user); + $this->assertObjectNotHasProperty('city', $user); } } } @@ -245,8 +245,8 @@ class userselector_test extends \advanced_testcase { $this->assertObjectHasAttribute('idnumber', $user); $this->assertObjectHasAttribute('country', $user); $this->assertObjectHasAttribute('city', $user); - $this->assertObjectNotHasAttribute('email', $user); - $this->assertObjectNotHasAttribute('department', $user); + $this->assertObjectNotHasProperty('email', $user); + $this->assertObjectNotHasProperty('department', $user); } } @@ -255,8 +255,8 @@ class userselector_test extends \advanced_testcase { $this->assertObjectHasAttribute('idnumber', $user); $this->assertObjectHasAttribute('country', $user); $this->assertObjectHasAttribute('city', $user); - $this->assertObjectNotHasAttribute('email', $user); - $this->assertObjectNotHasAttribute('department', $user); + $this->assertObjectNotHasProperty('email', $user); + $this->assertObjectNotHasProperty('department', $user); } } }