1 | <?php namespace ParaTest\Runners\PHPUnit; |
||
14 | class TestMethod extends ExecutableTest |
||
15 | { |
||
16 | /** |
||
17 | * The path to the test case file. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $path; |
||
22 | |||
23 | /** |
||
24 | * A set of filters for test, they are merged into phpunit's --filter option. |
||
25 | * |
||
26 | * @var string[] |
||
27 | */ |
||
28 | protected $filters; |
||
29 | |||
30 | /** |
||
31 | * Constructor. |
||
32 | * |
||
33 | * Passed filters must be unescaped and must represent test name, optionally including |
||
34 | * dataset name (numeric or named). |
||
35 | * |
||
36 | * @param string $testPath Path to phpunit test case file. |
||
37 | * @param string|string[] $filters Array of filters or single filter. |
||
38 | */ |
||
39 | 21 | public function __construct($testPath, $filters) |
|
46 | |||
47 | /** |
||
48 | * Returns the test method's filters. |
||
49 | * |
||
50 | * @return string[] |
||
51 | */ |
||
52 | public function getFilters() |
||
56 | |||
57 | /** |
||
58 | * Returns the test method's name. |
||
59 | * |
||
60 | * This method will join all filters via pipe character and return as string. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | 3 | public function getName() |
|
68 | |||
69 | /** |
||
70 | * Additional processing for options being passed to PHPUnit. |
||
71 | * |
||
72 | * This sets up the --filter switch used to run a single PHPUnit test method. |
||
73 | * This method also provide escaping for method name to be used as filter regexp. |
||
74 | * |
||
75 | * @param array $options |
||
76 | * @return array |
||
77 | */ |
||
78 | protected function prepareOptions($options) |
||
88 | |||
89 | /** |
||
90 | * Get the expected count of tests to be executed. |
||
91 | * |
||
92 | * @return int |
||
93 | */ |
||
94 | 1 | public function getTestCount() |
|
98 | } |
||
99 |