@@ 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. |
@@ 1067-1083 (lines=17) @@ | ||
1064 | $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match."); |
|
1065 | } |
|
1066 | ||
1067 | private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null) |
|
1068 | { |
|
1069 | $calls = $definition->getMethodCalls(); |
|
1070 | if (! isset($calls[$pos][0])) { |
|
1071 | $this->fail(sprintf('Method call at position %s not found!', $pos)); |
|
1072 | ||
1073 | return; |
|
1074 | } |
|
1075 | ||
1076 | $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.'); |
|
1077 | ||
1078 | if ($params === null) { |
|
1079 | return; |
|
1080 | } |
|
1081 | ||
1082 | $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters."); |
|
1083 | } |
|
1084 | ||
1085 | /** |
|
1086 | * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. |