Code Duplication    Length = 15-15 lines in 2 locations

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 1 location

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

Tests/DependencyInjection/DoctrineExtensionTest.php 1 location

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