Completed
Pull Request — master (#168)
by Juliette
02:29
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
 */
15
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...
16
{
17
18
    public $filename = 'sniff-examples/utility-functions/in_class_scope.php';
19
20
    /**
21
     * testInClassScope
22
     *
23
     * @group utilityFunctions
24
     *
25
     * @dataProvider dataInClassScope
26
     *
27
     * @param int    $stackPtr Stack pointer for an arbitrary token in the test file.
28
     * @param string $expected The expected boolean return value.
29
     */
30
    public function testInClassScope($stackPtr, $expected)
31
    {
32
        $result = $this->helperClass->inClassScope($this->_phpcsFile, $stackPtr);
33
        $this->assertSame($expected, $result);
34
    }
35
36
    /**
37
     * dataInClassScope
38
     *
39
     * @see testInClassScope()
40
     *
41
     * @return array
42
     */
43
    public function dataInClassScope()
44
    {
45
        return array(
46
            array(2, false), // $var
47
            array(9, false), // function
48
            array(28, true), // $property
49
            array(32, true), // function
50
            array(49, false), // function
51
            array(67, true), // function
52
        );
53
    }
54
55
}
56