From 924338a4908f8c741585d14e10242017b68bc00e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Pustu=C5=82ka?= Date: Fri, 1 Dec 2017 08:18:30 +0100 Subject: [PATCH] Fix test for removeRule() method. ValidationSet does not have a constructor defined. --- tests/TestCase/Validation/ValidationSetTest.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/TestCase/Validation/ValidationSetTest.php b/tests/TestCase/Validation/ValidationSetTest.php index c71c2b99248..cc6546b2f7f 100644 --- a/tests/TestCase/Validation/ValidationSetTest.php +++ b/tests/TestCase/Validation/ValidationSetTest.php @@ -191,19 +191,20 @@ public function testCount() */ public function testRemoveRule() { - $set = new ValidationSet('title', [ - '_validatePresent' => true, - 'notBlank' => ['rule' => 'notBlank'], - 'numeric' => ['rule' => 'numeric'], - 'other' => ['rule' => ['other', 1]], - ]); + $set = (new ValidationSet) + ->add('notBlank', ['rule' => 'notBlank']) + ->add('numeric', ['rule' => 'numeric']) + ->add('other', ['rule' => 'email']); + $this->assertTrue(isset($set['notBlank'])); $set->remove('notBlank'); $this->assertFalse(isset($set['notBlank'])); + $this->assertTrue(isset($set['numeric'])); $set->remove('numeric'); $this->assertFalse(isset($set['numeric'])); + $this->assertTrue(isset($set['other'])); $set->remove('other'); $this->assertFalse(isset($set['other'])); }