1 | <?php |
||
22 | class TestApplication |
||
23 | { |
||
24 | /** |
||
25 | * @var Application |
||
26 | */ |
||
27 | private $application; |
||
28 | |||
29 | /** |
||
30 | * @var string|null |
||
31 | */ |
||
32 | private $root; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $varname; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $basename; |
||
43 | |||
44 | /** |
||
45 | * @param string $varname name of the environment variable containing the test-root |
||
46 | * @param string $basename name of the stopfile containing the test-root |
||
47 | * |
||
48 | * @return string|null |
||
49 | */ |
||
50 | public static function getTestMagentoRootFromEnvironment($varname, $basename) |
||
80 | |||
81 | /** |
||
82 | * @return array |
||
83 | */ |
||
84 | public static function getConfig() |
||
91 | |||
92 | /** |
||
93 | * TestApplication constructor. |
||
94 | * |
||
95 | * @param string $varname [optional] name of the environment variable containing the path to magento-root |
||
96 | */ |
||
97 | public function __construct($varname = null, $basename = null) |
||
108 | |||
109 | /** |
||
110 | * getter for the magento root directory of the test-suite |
||
111 | * |
||
112 | * @see ApplicationTest::testExecute |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getTestMagentoRoot() |
||
134 | |||
135 | /** |
||
136 | * @return Application|PHPUnit_Framework_MockObject_MockObject |
||
137 | */ |
||
138 | public function getApplication() |
||
169 | |||
170 | /* |
||
171 | * PHPUnit TestCase methods |
||
172 | */ |
||
173 | |||
174 | /** |
||
175 | * Returns a matcher that matches when the method it is evaluated for |
||
176 | * is executed zero or more times. |
||
177 | * |
||
178 | * @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount |
||
179 | * @since Method available since Release 3.0.0 |
||
180 | */ |
||
181 | public static function any() |
||
185 | |||
186 | /** |
||
187 | * |
||
188 | * |
||
189 | * @param mixed $value |
||
190 | * @return PHPUnit_Framework_MockObject_Stub_Return |
||
191 | * @since Method available since Release 3.0.0 |
||
192 | */ |
||
193 | public static function returnValue($value) |
||
197 | |||
198 | /** |
||
199 | * Mark the test as skipped. |
||
200 | * |
||
201 | * @param string $message |
||
202 | * @throws PHPUnit_Framework_SkippedTestError |
||
203 | * @since Method available since Release 3.0.0 |
||
204 | */ |
||
205 | public static function markTestSkipped($message = '') |
||
209 | } |
||
210 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: