Code Duplication    Length = 15-17 lines in 2 locations

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 1 location

@@ 1081-1097 (lines=17) @@
1078
        $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match.");
1079
    }
1080
1081
    private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null)
1082
    {
1083
        $calls = $definition->getMethodCalls();
1084
        if (! isset($calls[$pos][0])) {
1085
            $this->fail(sprintf('Method call at position %s not found!', $pos));
1086
1087
            return;
1088
        }
1089
1090
        $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.');
1091
1092
        if ($params === null) {
1093
            return;
1094
        }
1095
1096
        $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters.");
1097
    }
1098
1099
    /**
1100
     * Assertion for the DI Container, check if the given definition contains a method call with the given parameters.

Tests/DependencyInjection/DoctrineExtensionTest.php 1 location

@@ 825-839 (lines=15) @@
822
        $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match.");
823
    }
824
825
    private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null)
826
    {
827
        $calls = $definition->getMethodCalls();
828
        if (! isset($calls[$pos][0])) {
829
            return;
830
        }
831
832
        $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.');
833
834
        if ($params === null) {
835
            return;
836
        }
837
838
        $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters.");
839
    }
840
841
    /**
842
     * Assertion for the DI Container, check if the given definition contains a method call with the given parameters.