@@ 837-851 (lines=15) @@ | ||
834 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
835 | } |
|
836 | ||
837 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
838 | { |
|
839 | $calls = $definition->getMethodCalls(); |
|
840 | if (! isset($calls[$pos][0])) { |
|
841 | return; |
|
842 | } |
|
843 | ||
844 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
845 | ||
846 | if ($params === null) { |
|
847 | return; |
|
848 | } |
|
849 | ||
850 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
851 | } |
|
852 | ||
853 | /** |
|
854 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |
@@ 1091-1107 (lines=17) @@ | ||
1088 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
1089 | } |
|
1090 | ||
1091 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
1092 | { |
|
1093 | $calls = $definition->getMethodCalls(); |
|
1094 | if (! isset($calls[$pos][0])) { |
|
1095 | $this->fail(sprintf('Method call at position %s not found!', $pos)); |
|
1096 | ||
1097 | return; |
|
1098 | } |
|
1099 | ||
1100 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
1101 | ||
1102 | if ($params === null) { |
|
1103 | return; |
|
1104 | } |
|
1105 | ||
1106 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
1107 | } |
|
1108 | ||
1109 | /** |
|
1110 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |