| @@ 953-967 (lines=15) @@ | ||
| 950 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 951 | } |
|
| 952 | ||
| 953 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
| 954 | { |
|
| 955 | $calls = $definition->getMethodCalls(); |
|
| 956 | if (! isset($calls[$pos][0])) { |
|
| 957 | return; |
|
| 958 | } |
|
| 959 | ||
| 960 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 961 | ||
| 962 | if ($params === null) { |
|
| 963 | return; |
|
| 964 | } |
|
| 965 | ||
| 966 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 967 | } |
|
| 968 | ||
| 969 | /** |
|
| 970 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|
| @@ 802-816 (lines=15) @@ | ||
| 799 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 800 | } |
|
| 801 | ||
| 802 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
| 803 | { |
|
| 804 | $calls = $definition->getMethodCalls(); |
|
| 805 | if (! isset($calls[$pos][0])) { |
|
| 806 | return; |
|
| 807 | } |
|
| 808 | ||
| 809 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 810 | ||
| 811 | if ($params === null) { |
|
| 812 | return; |
|
| 813 | } |
|
| 814 | ||
| 815 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 816 | } |
|
| 817 | ||
| 818 | /** |
|
| 819 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|