/** * @return null */ public function testFilterThousandsWithSpaces() { $params = new Dictionary(array('allow-thousands' => true)); $raw = '100, 000.00'; $result = $this->filter->filter($raw, $params); $this->assertTrue($this->filter->isFailure()); $this->assertNull($result); }
/** * depends testFalseWithStrictParams * @return null */ public function testFailedFalseWithStrictParams() { $params = new Dictionary(array('strict' => true)); $this->assertNull($this->filter->filter(false, $params), 'php filter_var does not think this is really false go figure'); $this->assertTrue($this->filter->isFailure()); /* the string false on the other hand is acceptable */ $this->assertFalse($this->filter->filter('false', $params)); $this->assertNull($this->filter->filter(null, $params), 'php filter_var does not consider null false'); $this->assertTrue($this->filter->isFailure()); $this->assertNull($this->filter->filter('null', $params), 'php filter_var does not consider null false'); $this->assertTrue($this->filter->isFailure()); $this->assertNull($this->filter->filter('abc', $params), 'php filter_var does not consider null false'); $this->assertTrue($this->filter->isFailure()); $this->assertTrue($this->filter->filter('1', $params)); }
/** * @depends testInvalidEmail * @dataProvider provideInValidEmails * @return null */ public function testInvalidEmailUsingDefault($raw) { $params = new Dictionary(array('default' => '*****@*****.**')); $this->assertEquals('*****@*****.**', $this->filter->filter($raw, $params)); $this->assertFalse($this->filter->isFailure()); }