Code Duplication    Length = 15-15 lines in 2 locations

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 1 location

@@ 955-969 (lines=15) @@
952
        $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match.");
953
    }
954
955
    private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null)
956
    {
957
        $calls = $definition->getMethodCalls();
958
        if (! isset($calls[$pos][0])) {
959
            return;
960
        }
961
962
        $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.');
963
964
        if ($params === null) {
965
            return;
966
        }
967
968
        $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters.");
969
    }
970
971
    /**
972
     * Assertion for the DI Container, check if the given definition contains a method call with the given parameters.

Tests/DependencyInjection/DoctrineExtensionTest.php 1 location

@@ 749-763 (lines=15) @@
746
        $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '" . $definition->getClass() . "' don't match.");
747
    }
748
749
    private function assertDICDefinitionMethodCallAt($pos, Definition $definition, $methodName, array $params = null)
750
    {
751
        $calls = $definition->getMethodCalls();
752
        if (! isset($calls[$pos][0])) {
753
            return;
754
        }
755
756
        $this->assertEquals($methodName, $calls[$pos][0], "Method '" . $methodName . "' is expected to be called at position " . $pos . '.');
757
758
        if ($params === null) {
759
            return;
760
        }
761
762
        $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '" . $methodName . "' do not match the actual parameters.");
763
    }
764
765
    /**
766
     * Assertion for the DI Container, check if the given definition contains a method call with the given parameters.