1 | <?php |
||
14 | class LegacyViewHelperWrapperTest extends PHPUnit_Framework_TestCase |
||
15 | { |
||
16 | /** |
||
17 | * @var BCViewHelperInterface|MockInterface |
||
18 | */ |
||
19 | private $helper; |
||
20 | |||
21 | /** |
||
22 | * @var LegacyViewHelper |
||
23 | */ |
||
24 | private $helperWrapper; |
||
25 | |||
26 | public function setUp() |
||
32 | |||
33 | public function testInnerHelperInvokeMethodShouldBeInvoked() |
||
41 | |||
42 | public function testHelperWrapperShouldBeCompatibleWithZendView() |
||
51 | |||
52 | /** |
||
53 | * @expectedException \RuntimeException |
||
54 | */ |
||
55 | public function testItShouldFailWhenHelperIsNotCallable() |
||
61 | |||
62 | /** |
||
63 | * @expectedException \InvalidArgumentException |
||
64 | */ |
||
65 | public function testHelperShouldBeCallableByNameOnly() |
||
73 | |||
74 | public function testDirect() |
||
78 | } |
||
79 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: