| @@ 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. |
|
| @@ 747-761 (lines=15) @@ | ||
| 744 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
| 745 | } |
|
| 746 | ||
| 747 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
| 748 | { |
|
| 749 | $calls = $definition->getMethodCalls(); |
|
| 750 | if (! isset($calls[$pos][0])) { |
|
| 751 | return; |
|
| 752 | } |
|
| 753 | ||
| 754 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
| 755 | ||
| 756 | if ($params === null) { |
|
| 757 | return; |
|
| 758 | } |
|
| 759 | ||
| 760 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
| 761 | } |
|
| 762 | ||
| 763 | /** |
|
| 764 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
|