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