1 | <?php |
||
7 | class TestFileLoader |
||
8 | { |
||
9 | /** |
||
10 | * The pattern used for grabbing test files. Uses the *Test.php convention |
||
11 | * that PHPUnit defaults to. |
||
12 | */ |
||
13 | const TEST_PATTERN = '/.+Test\.php$/'; |
||
14 | |||
15 | /** |
||
16 | * Matches php files |
||
17 | */ |
||
18 | const FILE_PATTERN = '/.+\.php$/'; |
||
19 | |||
20 | /** |
||
21 | * Used to ignore directory paths '.' and '..' |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | private static $dotPattern = '/([.]+)$/'; |
||
26 | |||
27 | /** |
||
28 | * The collection of loaded files for this test suite |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $files = array(); |
||
33 | |||
34 | /** |
||
35 | * The collection of excluded files |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $excludedFiles = array(); |
||
40 | |||
41 | /** |
||
42 | * When true, the SuiteLoader add the files to excluded files |
||
43 | * |
||
44 | * @var bool |
||
45 | */ |
||
46 | protected $excludingFiles = false; |
||
47 | |||
48 | /** |
||
49 | * @var Options |
||
50 | */ |
||
51 | private $options; |
||
52 | |||
53 | 25 | public function __construct($options = null) |
|
61 | |||
62 | /** |
||
63 | * Loads a SuitePath and makes sure to |
||
64 | * take into account the excluded directory / files |
||
65 | * |
||
66 | * @param SuitePath $path |
||
67 | * @return string[] |
||
68 | */ |
||
69 | 12 | public function loadSuitePath(SuitePath $path) |
|
88 | |||
89 | /** |
||
90 | * Loads suites based on a specific path. |
||
91 | * A valid path can be a directory or file |
||
92 | * |
||
93 | * @param $path |
||
94 | * @param $pattern |
||
95 | * @throws \InvalidArgumentException |
||
96 | * @return string[] |
||
97 | */ |
||
98 | 22 | public function loadPath($path, $pattern = null) |
|
115 | |||
116 | /** |
||
117 | * Loads suites from a directory |
||
118 | * |
||
119 | * @param string $path |
||
120 | * @param string $pattern |
||
121 | */ |
||
122 | 13 | private function loadDir($path, $pattern = self::TEST_PATTERN) |
|
129 | |||
130 | /** |
||
131 | * Load a single suite file |
||
132 | * |
||
133 | * @param $path |
||
134 | */ |
||
135 | 11 | private function loadFile($path) |
|
139 | |||
140 | /** |
||
141 | * Attempts to load suites from a path. |
||
142 | * |
||
143 | * @param string $path |
||
144 | * @param string $pattern regular expression for matching file names |
||
145 | */ |
||
146 | 20 | private function tryLoadTests($path, $pattern = self::TEST_PATTERN) |
|
160 | |||
161 | } |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.