Code Duplication    Length = 15-15 lines in 3 locations

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php 3 locations

@@ 862-876 (lines=15) @@
859
     * @expectedException \InvalidArgumentException
860
     * @expectedExceptionMessage EntityListenerServiceResolver
861
     */
862
    public function testLazyEntityListenerResolverWithoutCorrectInterface()
863
    {
864
        if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) {
865
            $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer');
866
        }
867
868
        $container = $this->getContainer(array());
869
        $loader = new DoctrineExtension();
870
        $container->registerExtension($loader);
871
        $container->addCompilerPass(new EntityListenerPass());
872
873
        $this->loadFromFile($container, 'orm_entity_listener_lazy_resolver_without_interface');
874
875
        $this->compileContainer($container);
876
    }
877
878
    /**
879
     * @expectedException \InvalidArgumentException
@@ 882-896 (lines=15) @@
879
     * @expectedException \InvalidArgumentException
880
     * @expectedExceptionMessageRegExp /The service ".*" must be public as this entity listener is lazy-loaded/
881
     */
882
    public function testPrivateLazyEntityListener()
883
    {
884
        if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) {
885
            $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer');
886
        }
887
888
        $container = $this->getContainer(array());
889
        $loader = new DoctrineExtension();
890
        $container->registerExtension($loader);
891
        $container->addCompilerPass(new EntityListenerPass());
892
893
        $this->loadFromFile($container, 'orm_entity_listener_lazy_private');
894
895
        $this->compileContainer($container);
896
    }
897
898
    /**
899
     * @expectedException \InvalidArgumentException
@@ 902-916 (lines=15) @@
899
     * @expectedException \InvalidArgumentException
900
     * @expectedExceptionMessageRegExp /The service ".*" must not be abstract as this entity listener is lazy-loaded/
901
     */
902
    public function testAbstractLazyEntityListener()
903
    {
904
        if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) {
905
            $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer');
906
        }
907
908
        $container = $this->getContainer(array());
909
        $loader = new DoctrineExtension();
910
        $container->registerExtension($loader);
911
        $container->addCompilerPass(new EntityListenerPass());
912
913
        $this->loadFromFile($container, 'orm_entity_listener_lazy_abstract');
914
915
        $this->compileContainer($container);
916
    }
917
918
    public function testRepositoryFactory()
919
    {