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( |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 15 | args( |
||||
| 16 | [ |
||||
| 17 | 'subpatterns'=>&$matches0, |
||||
| 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( |
||||
|
0 ignored issues
–
show
The method
preg_match() does not exist on EZAMA\namedArgs. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 30 | [ |
||||
| 31 | 'subpatterns'=>&$match, |
||||
| 32 | 'pattern'=>'#a|o|i|u|e#', |
||||
| 33 | 'subject'=>'gris|gros|gras|grue' |
||||
| 34 | ] |
||||
| 35 | ) |
||||
| 36 | ); |
||||
| 37 | } |
||||
| 38 | } |