filter: Add test for whitespace sanitizing
This commit is contained in:
parent
46078f50db
commit
56a1af47e7
|
@ -199,6 +199,16 @@ class FilterTest extends BaseTestCase
|
|||
$this->assertNotEquals((string) $c, (string) $d);
|
||||
}
|
||||
|
||||
public function testLeadingAndTrailingWhitespacesSanitizing()
|
||||
{
|
||||
$columnHasWhitespaces = Filter::where(' host ', 'localhost');
|
||||
$expressionHasWhitespaces = Filter::where('host', ' localhost ');
|
||||
$bothHaveWhitespaces = Filter::fromQueryString(' host = localhost ');
|
||||
$this->assertTrue($columnHasWhitespaces->matches($this->sampleData[0]));
|
||||
$this->assertTrue($expressionHasWhitespaces->matches($this->sampleData[0]));
|
||||
$this->assertTrue($bothHaveWhitespaces->matches($this->sampleData[0]));
|
||||
}
|
||||
|
||||
private function row($idx)
|
||||
{
|
||||
return $this->sampleData[$idx];
|
||||
|
|
Loading…
Reference in New Issue