/** * testCustomAsArray method * * @return void */ public function testCustomAsArray() { $this->assertTrue(Validation::custom(['check' => '12345', 'regex' => '/(?<!\\S)\\d++(?!\\S)/'])); $this->assertFalse(Validation::custom(['check' => 'Text', 'regex' => '/(?<!\\S)\\d++(?!\\S)/'])); $this->assertFalse(Validation::custom(['check' => '123.45', 'regex' => '/(?<!\\S)\\d++(?!\\S)/'])); }
/** * testCustomAsArray method * * @return void */ public function testCustomAsArray() { $this->assertTrue(Validation::custom('12345', '/(?<!\\S)\\d++(?!\\S)/')); $this->assertFalse(Validation::custom('Text', '/(?<!\\S)\\d++(?!\\S)/')); $this->assertFalse(Validation::custom('123.45', '/(?<!\\S)\\d++(?!\\S)/')); }