-
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.
- Loading branch information
Dragon
committed
Apr 18, 2024
1 parent
a15ae93
commit f308ee6
Showing
2 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Tests; | ||
|
||
use GUMP; | ||
|
||
class StaticHasFilterTest extends BaseTestCase | ||
{ | ||
public function testHasFilterWhenExists(): void | ||
{ | ||
$filterRules = [ | ||
// There are native filters | ||
'noise_words', | ||
'rmpunctuation', | ||
'urlencode', | ||
'htmlencode', | ||
'sanitize_email', | ||
'sanitize_numbers', | ||
'sanitize_floats', | ||
'sanitize_string', | ||
'boolean', | ||
'basic_tags', | ||
'whole_number', | ||
'ms_word_characters', | ||
'lower_case', | ||
'upper_case', | ||
'slug', | ||
// These are built-in functions | ||
'trim', | ||
'strtoupper', | ||
'strtolower', | ||
'intval', | ||
'floatval', | ||
]; | ||
|
||
foreach ($filterRules as $filterRule) { | ||
$this->assertTrue(GUMP::has_filter($filterRule)); | ||
} | ||
} | ||
|
||
public function testHasFilterWhenNotExists(): void | ||
{ | ||
$this->assertFalse(GUMP::has_filter('custom_filter')); | ||
} | ||
} |