1 | <?php |
||
31 | final class NullObjectFunctionalTest extends TestCase |
||
32 | { |
||
33 | /** |
||
34 | * @param mixed[] $params |
||
35 | * |
||
36 | * @dataProvider getProxyMethods |
||
37 | * |
||
38 | * @psalm-param class-string $className |
||
39 | */ |
||
40 | public function testMethodCalls(string $className, string $method, array $params) : void |
||
46 | |||
47 | /** |
||
48 | * @param mixed[] $params |
||
49 | * |
||
50 | * @dataProvider getProxyMethods |
||
51 | * |
||
52 | * @psalm-param class-string $className |
||
53 | */ |
||
54 | public function testMethodCallsAfterUnSerialization(string $className, string $method, array $params) : void |
||
61 | |||
62 | /** |
||
63 | * @param mixed[] $params |
||
64 | * |
||
65 | * @dataProvider getProxyMethods |
||
66 | * |
||
67 | * @psalm-param class-string $className |
||
68 | */ |
||
69 | public function testMethodCallsAfterCloning(string $className, string $method, array $params) : void |
||
75 | |||
76 | /** |
||
77 | * @dataProvider getPropertyAccessProxies |
||
78 | */ |
||
79 | public function testPropertyReadAccess(NullObjectInterface $proxy, string $publicProperty) : void |
||
83 | |||
84 | /** |
||
85 | * @dataProvider getPropertyAccessProxies |
||
86 | */ |
||
87 | public function testPropertyWriteAccess(NullObjectInterface $proxy, string $publicProperty) : void |
||
94 | |||
95 | /** |
||
96 | * @dataProvider getPropertyAccessProxies |
||
97 | */ |
||
98 | public function testPropertyExistence(NullObjectInterface $proxy, string $publicProperty) : void |
||
102 | |||
103 | /** |
||
104 | * @dataProvider getPropertyAccessProxies |
||
105 | */ |
||
106 | public function testPropertyUnset(NullObjectInterface $proxy, string $publicProperty) : void |
||
112 | |||
113 | /** |
||
114 | * Generates a list of object | invoked method | parameters | expected result |
||
115 | * |
||
116 | * @return string[][]|null[][]|mixed[][][]|object[][] |
||
117 | */ |
||
118 | public function getProxyMethods() : array |
||
180 | |||
181 | /** |
||
182 | * Generates proxies and instances with a public property to feed to the property accessor methods |
||
183 | * |
||
184 | * @return array<int, array<int, NullObjectInterface|string>> |
||
185 | */ |
||
186 | public function getPropertyAccessProxies() : array |
||
205 | |||
206 | /** |
||
207 | * @param mixed[] $parameters |
||
208 | */ |
||
209 | private function assertNullMethodCall(NullObjectInterface $proxy, string $methodName, array $parameters) : void |
||
219 | } |
||
220 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.