35 protected $testExtensionsToLoad = array(
'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example');
53 $this->importDataSet(ORIGINAL_ROOT .
'typo3/sysext/core/Tests/Functional/Fixtures/pages.xml');
54 $this->importDataSet(ORIGINAL_ROOT .
'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.xml');
55 $this->importDataSet(ORIGINAL_ROOT .
'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/posts.xml');
56 $this->importDataSet(ORIGINAL_ROOT .
'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags.xml');
57 $this->importDataSet(ORIGINAL_ROOT .
'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-tag-mm.xml');
60 $this->blogRepository = $this->objectManager->get(
'ExtbaseTeam\\BlogExample\\Domain\\Repository\\BlogRepository');
61 $this->postRepository = $this->objectManager->get(
'ExtbaseTeam\\BlogExample\\Domain\\Repository\\PostRepository');
69 $blog1 = $this->blogRepository->findByUid(1);
70 $blog2 = $this->blogRepository->findByUid(2);
72 $inQuery = $this->postRepository->createQuery();
75 $inQuery->in(
'blog', array($blog1, $blog2))
78 $this->assertSame(11, $inQuery->count());
85 $blog1 = $this->blogRepository->findByUid(1);
86 $blog2 = $this->blogRepository->findByUid(2);
88 $inQuery = $this->postRepository->createQuery();
91 $inQuery->in(
'blog', array($blog1, $blog2))
94 $this->assertSame(11, $inQuery->count());
96 $newInQuery = $this->postRepository->createQuery();
98 $newInQuery->matching(
99 $newInQuery->in(
'blog', array($blog1))
102 $this->assertSame(10, $newInQuery->count());
109 $blog1 = $this->blogRepository->findByUid(1);
110 $blog2 = $this->blogRepository->findByUid(2);
112 $objectStorage = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
113 $objectStorage->attach($blog1);
114 $objectStorage->attach($blog2);
116 $inQuery = $this->postRepository->createQuery();
119 $inQuery->in(
'blog', $objectStorage)
122 $this->assertSame(11, $inQuery->count());
129 $blog1 = $this->blogRepository->findByUid(1);
130 $blog2 = $this->blogRepository->findByUid(2);
132 $objectStorage = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
133 $objectStorage->attach($blog1);
134 $objectStorage->attach($blog2);
136 $inQuery = $this->postRepository->createQuery();
139 $inQuery->in(
'blog', $objectStorage)
142 $this->assertSame(11, $inQuery->count());
144 $newObjectStorage = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
145 $newObjectStorage->attach($blog1);
147 $newInQuery = $this->postRepository->createQuery();
149 $newInQuery->matching(
150 $newInQuery->in(
'blog', $newObjectStorage)
153 $this->assertSame(10, $newInQuery->count());
160 $queryResult = $this->blogRepository->findAll();
162 $inQuery = $this->postRepository->createQuery();
165 $inQuery->in(
'blog', $queryResult)
168 $this->assertSame(11, $inQuery->count());
176 $queryResult = $this->blogRepository->findAll();
178 $inQuery = $this->postRepository->createQuery();
181 $inQuery->in(
'blog', $queryResult)
184 $this->assertSame(11, $inQuery->count());
186 $newInQuery = $this->postRepository->createQuery();
188 $newInQuery->matching(
189 $newInQuery->in(
'blog', $queryResult)
192 $this->assertSame(11, $newInQuery->count());
199 $blog = $this->blogRepository->findByUid(1);
201 $this->assertInstanceOf(
202 '\TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage',
206 $inQuery = $this->postRepository->createQuery();
209 $inQuery->in(
'uid', $blog->getPosts())
212 $this->assertSame(10, $inQuery->count());
219 $blog = $this->blogRepository->findByUid(1);
221 $this->assertInstanceOf(
222 '\TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage',
226 $inQuery = $this->postRepository->createQuery();
229 $inQuery->in(
'uid', $blog->getPosts())
232 $this->assertSame(10, $inQuery->count());
235 $newInQuery = $this->postRepository->createQuery();
237 $newInQuery->matching(
238 $newInQuery->in(
'uid', $blog->getPosts())
241 $this->assertSame(10, $newInQuery->count());
inConditionWorksWithQueryResultOnSecondCall()
static makeInstance($className)
inConditionWorksWithArrayOfObjects()
inConditionWorksWithLazyObjectStorageOnSecondCall()
inConditionWorksWithObjectStorage()
inConditionWorksWithQueryResult()
inConditionWorksWithLazyObjectStorage()
inConditionWorksWithArrayOfObjectsOnSecondCall()
inConditionWorksWithObjectStorageOnSecondCall()