Skip to content

Commit

Permalink
Merge pull request #972 from odiel/patch-1
Browse files Browse the repository at this point in the history
Adding asserts to String filter
  • Loading branch information
Phalcon committed Aug 2, 2013
2 parents da5d779 + 1b62092 commit 30a4478
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions php-tests/tests/Phalcon/Filter/UnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@ public function testSanitizeStringStringFilter()
$expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+';
$actual = $filter->sanitize($source, 'string');

$this->assertEquals(
$expected,
$actual,
'String filter with latin does not return correct data'
);


$source = 'this is a string>{';

$expected = 'this is a string';
$actual = $filter->sanitize($source, 'string');

$this->assertEquals(
$expected,
$actual,
'String filter with latin does not return correct data'
);


$source = '{[<<whitin french quotes>>]}';

$expected = 'whitin french quotes';
$actual = $filter->sanitize($source, 'string');

$this->assertEquals(
$expected,
$actual,
Expand Down Expand Up @@ -71,6 +95,30 @@ public function testSanitizeStringUTF8StringFilter()
$actual,
'String filter with UTF8 does not return correct data'
);


$source = 'buenos días 123 καλημέρα! 早安>';

$expected = 'buenos días 123 καλημέρα! 早安';
$actual = $filter->sanitize($source, 'string');

$this->assertEquals(
$expected,
$actual,
'String filter with latin does not return correct data'
);


$source = '{[<<buenos días 123 καλημέρα! 早安>>]}';

$expected = 'buenos días 123 καλημέρα! 早安';
$actual = $filter->sanitize($source, 'string');

$this->assertEquals(
$expected,
$actual,
'String filter with latin does not return correct data'
);
}

/**
Expand Down Expand Up @@ -837,3 +885,6 @@ public function testSanitizeArrayMultipleFilters()
}
}

);

$this-

0 comments on commit 30a4478

Please sign in to comment.