| 1 | <?php |
||
| 19 | abstract class TestCase extends PHPUnit_Framework_TestCase |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var TestApplication |
||
| 23 | */ |
||
| 24 | private $testApplication; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * |
||
| 28 | * @param string $type |
||
| 29 | * @return object of $type configured by Magento DI of the test-application |
||
| 30 | */ |
||
| 31 | public function getObject($type) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return TestApplication |
||
| 42 | */ |
||
| 43 | private function getTestApplication() |
||
| 51 | } |
||
| 52 |
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: