Completed
Pull Request — master (#168)
by Juliette
03:54
created

InClassScopeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
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 41
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testInClassScope() 0 5 1
A dataInClassScope() 0 11 1
1
<?php
2
/**
3
 * In class scope test file
4
 *
5
 * @package PHPCompatibility
6
 */
7
8
9
/**
10
 * In class scope function tests
11
 *
12
 * @uses    BaseSniffTest
13
 * @package PHPCompatibility
14
 * @author  Juliette Reinders Folmer <[email protected]>
15
 */
16
class InClassScopeTest extends BaseAbstractClassMethodTest
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...
17
{
18
19
    public $filename = 'sniff-examples/utility-functions/in_class_scope.php';
20
21
    /**
22
     * testInClassScope
23
     *
24
     * @group utilityFunctions
25
     *
26
     * @dataProvider dataInClassScope
27
     *
28
     * @param int    $stackPtr Stack pointer for an arbitrary token in the test file.
29
     * @param string $expected The expected boolean return value.
30
     */
31
    public function testInClassScope($stackPtr, $expected)
32
    {
33
        $result = $this->helperClass->inClassScope($this->_phpcsFile, $stackPtr);
34
        $this->assertSame($expected, $result);
35
    }
36
37
    /**
38
     * dataInClassScope
39
     *
40
     * @see testInClassScope()
41
     *
42
     * @return array
43
     */
44
    public function dataInClassScope()
45
    {
46
        return array(
47
            array(2, false), // $var
48
            array(9, false), // function
49
            array(28, true), // $property
50
            array(32, true), // function
51
            array(49, false), // function
52
            array(67, true), // function
53
        );
54
    }
55
56
}
57