/** * test addBlacklistPattern */ function testStringVR_addBlacklistPattern() { $svr = new StringValidationRule('A_String', null, null); $svr->addBlacklistPattern('^[abc]+$'); $this->assertTrue($svr->isValid('testStringVR_addBlacklistPattern', 'dddddd')); $this->assertFalse($svr->isValid('testStringVR_addBlacklistPattern', 'aabbcc')); $svr->addBlacklistPattern('^[abcd]+$'); // input must pass both patterns! $this->assertTrue($svr->isValid('testStringVR_addBlacklistPattern', 'eeeeee')); $this->assertFalse($svr->isValid('testStringVR_addBlacklistPattern', 'dddddd')); }