Code Duplication    Length = 15-15 lines in 2 locations

Tests/DependencyInjection/DoctrineExtensionTest.php 1 location

@@ 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.

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 1 location

@@ 1007-1021 (lines=15) @@
1004
        $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match.");
1005
    }
1006
1007
    private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null)
1008
    {
1009
        $calls = $definition->getMethodCalls();
1010
        if (! isset($calls[$pos][0])) {
1011
            return;
1012
        }
1013
1014
        $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.');
1015
1016
        if ($params === null) {
1017
            return;
1018
        }
1019
1020
        $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters.");
1021
    }
1022
1023
    /**
1024
     * Assertion for the DI Container, check if the given definition contains a method call with the given parameters.