Code Duplication    Length = 15-15 lines in 3 locations

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 3 locations

@@ 887-901 (lines=15) @@
884
     * @expectedException \InvalidArgumentException
885
     * @expectedExceptionMessage EntityListenerServiceResolver
886
     */
887
    public function testLazyEntityListenerResolverWithoutCorrectInterface()
888
    {
889
        if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) {
890
            $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer');
891
        }
892
893
        $container = $this->getContainer(array());
894
        $loader = new DoctrineExtension();
895
        $container->registerExtension($loader);
896
        $container->addCompilerPass(new EntityListenerPass());
897
898
        $this->loadFromFile($container, 'orm_entity_listener_lazy_resolver_without_interface');
899
900
        $this->compileContainer($container);
901
    }
902
903
    /**
904
     * @expectedException \InvalidArgumentException
@@ 907-921 (lines=15) @@
904
     * @expectedException \InvalidArgumentException
905
     * @expectedExceptionMessageRegExp /The service ".*" must be public as this entity listener is lazy-loaded/
906
     */
907
    public function testPrivateLazyEntityListener()
908
    {
909
        if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) {
910
            $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer');
911
        }
912
913
        $container = $this->getContainer(array());
914
        $loader = new DoctrineExtension();
915
        $container->registerExtension($loader);
916
        $container->addCompilerPass(new EntityListenerPass());
917
918
        $this->loadFromFile($container, 'orm_entity_listener_lazy_private');
919
920
        $this->compileContainer($container);
921
    }
922
923
    /**
924
     * @expectedException \InvalidArgumentException
@@ 927-941 (lines=15) @@
924
     * @expectedException \InvalidArgumentException
925
     * @expectedExceptionMessageRegExp /The service ".*" must not be abstract as this entity listener is lazy-loaded/
926
     */
927
    public function testAbstractLazyEntityListener()
928
    {
929
        if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) {
930
            $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer');
931
        }
932
933
        $container = $this->getContainer(array());
934
        $loader = new DoctrineExtension();
935
        $container->registerExtension($loader);
936
        $container->addCompilerPass(new EntityListenerPass());
937
938
        $this->loadFromFile($container, 'orm_entity_listener_lazy_abstract');
939
940
        $this->compileContainer($container);
941
    }
942
943
    public function testRepositoryFactory()
944
    {