| @@ 1040-1056 (lines=17) @@ | ||
| 1037 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 1038 | } |
|
| 1039 | ||
| 1040 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
| 1041 | { |
|
| 1042 | $calls = $definition->getMethodCalls(); |
|
| 1043 | if (! isset($calls[$pos][0])) { |
|
| 1044 | $this->fail(sprintf('Method call at position %s not found!', $pos)); |
|
| 1045 | ||
| 1046 | return; |
|
| 1047 | } |
|
| 1048 | ||
| 1049 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 1050 | ||
| 1051 | if ($params === null) { |
|
| 1052 | return; |
|
| 1053 | } |
|
| 1054 | ||
| 1055 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 1056 | } |
|
| 1057 | ||
| 1058 | /** |
|
| 1059 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|
| @@ 832-846 (lines=15) @@ | ||
| 829 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 830 | } |
|
| 831 | ||
| 832 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
| 833 | { |
|
| 834 | $calls = $definition->getMethodCalls(); |
|
| 835 | if (! isset($calls[$pos][0])) { |
|
| 836 | return; |
|
| 837 | } |
|
| 838 | ||
| 839 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 840 | ||
| 841 | if ($params === null) { |
|
| 842 | return; |
|
| 843 | } |
|
| 844 | ||
| 845 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 846 | } |
|
| 847 | ||
| 848 | /** |
|
| 849 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|