Code Duplication    Length = 15-15 lines in 2 locations

Tests/DependencyInjection/DoctrineExtensionTest.php 1 location

@@ 784-798 (lines=15) @@
781
        $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match.");
782
    }
783
784
    private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null)
785
    {
786
        $calls = $definition->getMethodCalls();
787
        if (! isset($calls[$pos][0])) {
788
            return;
789
        }
790
791
        $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.');
792
793
        if ($params === null) {
794
            return;
795
        }
796
797
        $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters.");
798
    }
799
800
    /**
801
     * Assertion for the DI Container, check if the given definition contains a method call with the given parameters.

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 1 location

@@ 1023-1037 (lines=15) @@
1020
        $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match.");
1021
    }
1022
1023
    private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null)
1024
    {
1025
        $calls = $definition->getMethodCalls();
1026
        if (! isset($calls[$pos][0])) {
1027
            return;
1028
        }
1029
1030
        $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.');
1031
1032
        if ($params === null) {
1033
            return;
1034
        }
1035
1036
        $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters.");
1037
    }
1038
1039
    /**
1040
     * Assertion for the DI Container, check if the given definition contains a method call with the given parameters.