manuwhat /
named-args
| 1 | <?php |
||
| 2 | use PHPUnit\Framework\TestCase; |
||
| 3 | |||
| 4 | |||
| 5 | require ($dir = dirname(__DIR__)).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'namedArgsHelper.php'; |
||
| 6 | require ($dir = dirname(__DIR__)).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'namedArgs.php'; |
||
| 7 | require $dir.DIRECTORY_SEPARATOR.'Args.php'; |
||
| 8 | use EZAMA\NamedArgs; |
||
| 9 | class NamedArgsTest extends TestCase |
||
| 10 | { |
||
| 11 | public function testStaticCall() |
||
| 12 | { |
||
| 13 | $this->assertEquals( |
||
| 14 | NamedArgs::preg_match_all( |
||
| 15 | args( |
||
| 16 | [ |
||
| 17 | 'subpatterns'=>&$matches0, |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
| 18 | 'pattern'=>'#a|o|i|u|e#', |
||
| 19 | 'subject'=>'gris|gros|gras|grue' |
||
| 20 | ] |
||
| 21 | ) |
||
| 22 | ), |
||
| 23 | preg_match_all('#a|o|i|u|e#', 'gris|gros|gras|grue', $matches1) |
||
| 24 | ); |
||
| 25 | |||
| 26 | $this->assertEquals($matches0, $matches1); |
||
| 27 | |||
| 28 | $this->assertTrue( |
||
| 29 | (bool) NamedArgs::preg_match( |
||
| 30 | [ |
||
| 31 | 'subpatterns'=>&$match, |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 32 | 'pattern'=>'#a|o|i|u|e#', |
||
| 33 | 'subject'=>'gris|gros|gras|grue' |
||
| 34 | ] |
||
| 35 | ) |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | } |