Completed
Pull Request — master (#215)
by Juliette
03:11
created

BaseClass_DoesFunctionCallHaveParametersTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 43
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testDoesFunctionCallHaveParameters() 0 4 1
A dataDoesFunctionCallHaveParameters() 0 12 1
1
<?php
2
/**
3
 * Function parameters test file
4
 *
5
 * @package PHPCompatibility
6
 */
7
8
9
/**
10
 * Function parameters function tests
11
 *
12
 * @uses    BaseClass_MethodTestFrame
13
 * @package PHPCompatibility
14
 */
15
class BaseClass_DoesFunctionCallHaveParametersTest extends BaseClass_MethodTestFrame
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
16
{
17
18
	public $filename = '../sniff-examples/utility-functions/does_function_call_have_parameters.php';
19
20
    /**
21
     * testDoesFunctionCallHaveParameters
22
     *
23
     * @group utilityFunctions
24
     *
25
     * @dataProvider dataDoesFunctionCallHaveParameters
26
     *
27
     * @covers PHPCompatibility_Sniff::doesFunctionCallHaveParameters
28
     *
29
     * @param int    $stackPtr Stack pointer for a T_CLASS token in the test file.
30
     * @param string $expected The expected fully qualified class name.
31
     */
32
    public function testDoesFunctionCallHaveParameters($stackPtr, $expected) {
33
        $result = $this->helperClass->doesFunctionCallHaveParameters($this->_phpcsFile, $stackPtr);
34
        $this->assertSame($expected, $result);
35
    }
36
37
    /**
38
     * dataDoesFunctionCallHaveParameters
39
     *
40
     * @see testDoesFunctionCallHaveParameters()
41
     *
42
     * @return array
43
     */
44
    public function dataDoesFunctionCallHaveParameters()
45
    {
46
        return array(
47
            array(12, false),
48
            array(17, false),
49
            array(23, false),
50
            array(31, false),
51
            array(42, true),
52
            array(50, true),
53
            array(60, true),
54
        );
55
    }
56
57
}
58