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