Code Duplication    Length = 15-15 lines in 2 locations

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 1 location

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

Tests/DependencyInjection/DoctrineExtensionTest.php 1 location

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