/** * Test removeRule method * * @return void */ public function testRemoveRule() { $set = new ValidationSet('title', ['_validatePresent' => true, 'notBlank' => ['rule' => 'notBlank'], 'numeric' => ['rule' => 'numeric'], 'other' => ['rule' => ['other', 1]]]); $set->remove('notBlank'); $this->assertFalse(isset($set['notBlank'])); $set->remove('numeric'); $this->assertFalse(isset($set['numeric'])); $set->remove('other'); $this->assertFalse(isset($set['other'])); }
/** * Test removeRule method * * @return void */ public function testRemoveRule() { $set = new ValidationSet('title', array('_validatePresent' => true, 'notEmpty' => array('rule' => 'notEmpty'), 'numeric' => array('rule' => 'numeric'), 'other' => array('rule' => array('other', 1)))); $set->remove('notEmpty'); $this->assertFalse(isset($set['notEmpty'])); $set->remove('numeric'); $this->assertFalse(isset($set['numeric'])); $set->remove('other'); $this->assertFalse(isset($set['other'])); }