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

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