Passed
Push — master ( 62fbb4...6eecf2 )
by Akpé Aurelle Emmanuel Moïse
02:00
created

NamedArgsTest::testStaticCall()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 13
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 23
rs 9.8333
1
<?php
2
use PHPUnit\Framework\TestCase;
3
4
require($dir=dirname(__DIR__)).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'NamedArgs.php';
5
require $dir.DIRECTORY_SEPARATOR.'Args.php';
6
use EZAMA\NamedArgs;
7
8
class NamedArgsTest extends TestCase
9
{
10
    public function testStaticCall()
11
    {
12
        $this->assertEquals(
13
            NamedArgs::preg_match_all(
0 ignored issues
show
Bug introduced by
The method preg_match_all() 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 ignore-call  annotation

13
            NamedArgs::/** @scrutinizer ignore-call */ 
14
                       preg_match_all(
Loading history...
14
                args(
15
                    [
16
                        'subpatterns'=>&$matches0,
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $matches0 seems to be never defined.
Loading history...
17
                        'pattern'=>'#a|o|i|u|e#',
18
                        'subject'=>'gris|gros|gras|grue'
19
                    ]
20
                )
21
         ),
22
            preg_match_all('#a|o|i|u|e#', 'gris|gros|gras|grue', $matches1)
23
        );
24
        
25
        $this->assertEquals($matches0, $matches1);
26
        
27
        $this->assertTrue(
28
            (bool)NamedArgs::preg_match(
0 ignored issues
show
Bug introduced by
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 ignore-call  annotation

28
            (bool)NamedArgs::/** @scrutinizer ignore-call */ preg_match(
Loading history...
29
                [
30
                            'subpatterns'=>&$match,
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $match seems to be never defined.
Loading history...
31
                            'pattern'=>'#a|o|i|u|e#',
32
                            'subject'=>'gris|gros|gras|grue'
33
                ]
34
            )
35
        );
36
    }
37
}
38