Skip to content

Commit

Permalink
Fix test for removeRule() method. ValidationSet does not have a const…
Browse files Browse the repository at this point in the history
…ructor defined.
  • Loading branch information
robertpustulka committed Dec 1, 2017
1 parent 4217dd9 commit 924338a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/TestCase/Validation/ValidationSetTest.php
Expand Up @@ -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']));
}
Expand Down

0 comments on commit 924338a

Please sign in to comment.