From a3d5068083b465a2ede09f34675dc177379156d0 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 20 Oct 2014 15:53:19 +0100 Subject: [PATCH] MDL-47726 availability: fix tests when there is a text custom field This unit tests assumed that on a fresh install, there were no custom user-profile fields. Given some third-party plugins, that assumption is false. --- availability/condition/profile/tests/condition_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/availability/condition/profile/tests/condition_test.php b/availability/condition/profile/tests/condition_test.php index df9e0856485..e2250e22d06 100644 --- a/availability/condition/profile/tests/condition_test.php +++ b/availability/condition/profile/tests/condition_test.php @@ -342,7 +342,8 @@ class availability_profile_condition_testcase extends advanced_testcase { // The list of fields should include the text field added in setUp(), // but should not include the textarea field added just now. $fields = condition::get_custom_profile_fields(); - $this->assertEquals(array('frogtype'), array_keys($fields)); + $this->assertArrayHasKey('frogtype', $fields); + $this->assertArrayNotHasKey('longtext', $fields); } /** -- 2.43.0