@@ 922-936 (lines=15) @@ | ||
919 | * @expectedException \InvalidArgumentException |
|
920 | * @expectedExceptionMessage EntityListenerServiceResolver |
|
921 | */ |
|
922 | public function testLazyEntityListenerResolverWithoutCorrectInterface() |
|
923 | { |
|
924 | if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) { |
|
925 | $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer'); |
|
926 | } |
|
927 | ||
928 | $container = $this->getContainer(array()); |
|
929 | $loader = new DoctrineExtension(); |
|
930 | $container->registerExtension($loader); |
|
931 | $container->addCompilerPass(new EntityListenerPass()); |
|
932 | ||
933 | $this->loadFromFile($container, 'orm_entity_listener_lazy_resolver_without_interface'); |
|
934 | ||
935 | $this->compileContainer($container); |
|
936 | } |
|
937 | ||
938 | /** |
|
939 | * @expectedException \InvalidArgumentException |
|
@@ 942-956 (lines=15) @@ | ||
939 | * @expectedException \InvalidArgumentException |
|
940 | * @expectedExceptionMessageRegExp /The service ".*" must be public as this entity listener is lazy-loaded/ |
|
941 | */ |
|
942 | public function testPrivateLazyEntityListener() |
|
943 | { |
|
944 | if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) { |
|
945 | $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer'); |
|
946 | } |
|
947 | ||
948 | $container = $this->getContainer(array()); |
|
949 | $loader = new DoctrineExtension(); |
|
950 | $container->registerExtension($loader); |
|
951 | $container->addCompilerPass(new EntityListenerPass()); |
|
952 | ||
953 | $this->loadFromFile($container, 'orm_entity_listener_lazy_private'); |
|
954 | ||
955 | $this->compileContainer($container); |
|
956 | } |
|
957 | ||
958 | /** |
|
959 | * @expectedException \InvalidArgumentException |
|
@@ 962-976 (lines=15) @@ | ||
959 | * @expectedException \InvalidArgumentException |
|
960 | * @expectedExceptionMessageRegExp /The service ".*" must not be abstract as this entity listener is lazy-loaded/ |
|
961 | */ |
|
962 | public function testAbstractLazyEntityListener() |
|
963 | { |
|
964 | if (version_compare(Version::VERSION, '2.5.0-DEV') < 0) { |
|
965 | $this->markTestSkipped('Attaching entity listeners by tag requires doctrine-orm 2.5.0 or newer'); |
|
966 | } |
|
967 | ||
968 | $container = $this->getContainer(array()); |
|
969 | $loader = new DoctrineExtension(); |
|
970 | $container->registerExtension($loader); |
|
971 | $container->addCompilerPass(new EntityListenerPass()); |
|
972 | ||
973 | $this->loadFromFile($container, 'orm_entity_listener_lazy_abstract'); |
|
974 | ||
975 | $this->compileContainer($container); |
|
976 | } |
|
977 | ||
978 | public function testRepositoryFactory() |
|
979 | { |