| @@ 1027-1043 (lines=17) @@ | ||
| 1024 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 1025 | } |
|
| 1026 | ||
| 1027 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
| 1028 | { |
|
| 1029 | $calls = $definition->getMethodCalls(); |
|
| 1030 | if (! isset($calls[$pos][0])) { |
|
| 1031 | $this->fail(sprintf('Method call at position %s not found!', $pos)); |
|
| 1032 | ||
| 1033 | return; |
|
| 1034 | } |
|
| 1035 | ||
| 1036 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 1037 | ||
| 1038 | if ($params === null) { |
|
| 1039 | return; |
|
| 1040 | } |
|
| 1041 | ||
| 1042 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 1043 | } |
|
| 1044 | ||
| 1045 | /** |
|
| 1046 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|
| @@ 843-857 (lines=15) @@ | ||
| 840 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 841 | } |
|
| 842 | ||
| 843 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
| 844 | { |
|
| 845 | $calls = $definition->getMethodCalls(); |
|
| 846 | if (! isset($calls[$pos][0])) { |
|
| 847 | return; |
|
| 848 | } |
|
| 849 | ||
| 850 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 851 | ||
| 852 | if ($params === null) { |
|
| 853 | return; |
|
| 854 | } |
|
| 855 | ||
| 856 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 857 | } |
|
| 858 | ||
| 859 | /** |
|
| 860 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|