-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Wixel/GUMP
- Loading branch information
Showing
14 changed files
with
556 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Tests\Filters; | ||
|
||
use GUMP; | ||
use Exception; | ||
use Tests\BaseTestCase; | ||
|
||
/** | ||
* Class BasicTagsFilterTest | ||
* | ||
* @package Tests | ||
*/ | ||
class BasicTagsFilterTest extends BaseTestCase | ||
{ | ||
private const FILTER = 'basic_tags'; | ||
|
||
/** | ||
* @dataProvider successProvider | ||
*/ | ||
public function testSuccess($input, $expected) | ||
{ | ||
$result = $this->filter(self::FILTER, $input); | ||
|
||
$this->assertEquals($result, $expected); | ||
} | ||
|
||
public function successProvider() | ||
{ | ||
return [ | ||
['<script>alert(1);</script>hello', 'alert(1);hello'] | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Tests\Filters; | ||
|
||
use GUMP; | ||
use Exception; | ||
use Tests\BaseTestCase; | ||
|
||
/** | ||
* Class LowerFilterTest | ||
* | ||
* @package Tests | ||
*/ | ||
class LowerFilterTest extends BaseTestCase | ||
{ | ||
private const FILTER = 'lower_case'; | ||
|
||
/** | ||
* @dataProvider successProvider | ||
*/ | ||
public function testSuccess($input, $expected) | ||
{ | ||
$result = $this->filter(self::FILTER, $input); | ||
$this->assertEquals($result, $expected); | ||
} | ||
|
||
public function successProvider() | ||
{ | ||
return [ | ||
['Hello', 'hello'] | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Tests\Filters; | ||
|
||
use GUMP; | ||
use Exception; | ||
use Tests\BaseTestCase; | ||
|
||
/** | ||
* Class SlugFilterTest | ||
* | ||
* @package Tests | ||
*/ | ||
class SlugFilterTest extends BaseTestCase | ||
{ | ||
private const FILTER = 'slug'; | ||
|
||
/** | ||
* @dataProvider successProvider | ||
*/ | ||
public function testSuccess($input, $expected) | ||
{ | ||
$result = $this->filter(self::FILTER, $input); | ||
$this->assertEquals($result, $expected); | ||
} | ||
|
||
public function successProvider() | ||
{ | ||
return [ | ||
['test spaceñ', 'test-spacen'], | ||
['test space', 'test-space'], | ||
['test', 'test'], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Tests\Filters; | ||
|
||
use GUMP; | ||
use Exception; | ||
use Tests\BaseTestCase; | ||
|
||
/** | ||
* Class WholeNumberFilterTest | ||
* | ||
* @package Tests | ||
*/ | ||
class WholeNumberFilterTest extends BaseTestCase | ||
{ | ||
private const FILTER = 'whole_number'; | ||
|
||
/** | ||
* @dataProvider successProvider | ||
*/ | ||
public function testSuccess($input, $expected) | ||
{ | ||
$result = $this->filter(self::FILTER, $input); | ||
|
||
$this->assertEquals($result, $expected); | ||
} | ||
|
||
public function successProvider() | ||
{ | ||
return [ | ||
[1, 1], | ||
['-1', '-1'], | ||
[4.2, 4], | ||
['042', '42'], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.