| @@ 1082-1102 (lines=21) @@ | ||
| 1079 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 1080 | } |
|
| 1081 | ||
| 1082 | private function assertDICDefinitionMethodCallAt( |
|
| 1083 | int $pos, |
|
| 1084 | Definition $definition, |
|
| 1085 | string $methodName, |
|
| 1086 | array $params = null |
|
| 1087 | ) : void { |
|
| 1088 | $calls = $definition->getMethodCalls(); |
|
| 1089 | if (! isset($calls[$pos][0])) { |
|
| 1090 | $this->fail(sprintf('Method call at position %s not found!', $pos)); |
|
| 1091 | ||
| 1092 | return; |
|
| 1093 | } |
|
| 1094 | ||
| 1095 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 1096 | ||
| 1097 | if ($params === null) { |
|
| 1098 | return; |
|
| 1099 | } |
|
| 1100 | ||
| 1101 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 1102 | } |
|
| 1103 | ||
| 1104 | /** |
|
| 1105 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|
| @@ 846-860 (lines=15) @@ | ||
| 843 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 844 | } |
|
| 845 | ||
| 846 | private function assertDICDefinitionMethodCallAt(int $pos, Definition $definition, string $methodName, array $params = null) : void |
|
| 847 | { |
|
| 848 | $calls = $definition->getMethodCalls(); |
|
| 849 | if (! isset($calls[$pos][0])) { |
|
| 850 | return; |
|
| 851 | } |
|
| 852 | ||
| 853 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 854 | ||
| 855 | if ($params === null) { |
|
| 856 | return; |
|
| 857 | } |
|
| 858 | ||
| 859 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 860 | } |
|
| 861 | ||
| 862 | /** |
|
| 863 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|