src/OpenOrchestra/Tests/Functional/ModelBundle/Repository/KeywordRepositoryTest.php 1 location
|
@@ 102-117 (lines=16) @@
|
99 |
|
/** |
100 |
|
* Test remove keywords |
101 |
|
*/ |
102 |
|
public function testRemoveKeywords() |
103 |
|
{ |
104 |
|
$dm = static::$kernel->getContainer()->get('object_manager'); |
105 |
|
$lorem = $this->repository->findOneByLabel('lorem'); |
106 |
|
$dolor = $this->repository->findOneByLabel('dolor'); |
107 |
|
|
108 |
|
$keywordIds = array($lorem->geTId(), $dolor->getId()); |
109 |
|
|
110 |
|
$this->repository->removeKeywords($keywordIds); |
111 |
|
$this->assertNull($this->repository->findOneByLabel('lorem')); |
112 |
|
$this->assertNull($this->repository->findOneByLabel('dolor')); |
113 |
|
|
114 |
|
$dm->persist(clone $lorem); |
115 |
|
$dm->persist(clone $dolor); |
116 |
|
$dm->flush(); |
117 |
|
} |
118 |
|
} |
119 |
|
|
src/OpenOrchestra/Tests/Functional/ModelBundle/Repository/StatustRepositoryTest.php 1 location
|
@@ 111-126 (lines=16) @@
|
108 |
|
/** |
109 |
|
* Test remove statuses |
110 |
|
*/ |
111 |
|
public function testRemoveStatuses() |
112 |
|
{ |
113 |
|
$dm = static::$kernel->getContainer()->get('object_manager'); |
114 |
|
$statusPending = $this->repository->findOneByName('pending'); |
115 |
|
$statusPublished = $this->repository->findOneByName('published'); |
116 |
|
|
117 |
|
$statusIds = array($statusPending->getId(), $statusPublished->getId()); |
118 |
|
|
119 |
|
$this->repository->removeStatuses($statusIds); |
120 |
|
$this->assertNull($this->repository->findOneByName('pending')); |
121 |
|
$this->assertNull($this->repository->findOneByName('published')); |
122 |
|
|
123 |
|
$dm->persist(clone $statusPending); |
124 |
|
$dm->persist(clone $statusPublished); |
125 |
|
$dm->flush(); |
126 |
|
} |
127 |
|
} |
128 |
|
|
src/OpenOrchestra/Tests/Functional/UserAdminBundle/Repository/UserRepositoryTest.php 1 location
|
@@ 183-198 (lines=16) @@
|
180 |
|
/** |
181 |
|
* Test remove users |
182 |
|
*/ |
183 |
|
public function testRemoveUsers() |
184 |
|
{ |
185 |
|
$dm = static::$kernel->getContainer()->get('object_manager'); |
186 |
|
$userDemo = $this->repository->findOneByUsername('demo'); |
187 |
|
$userSAdmin = $this->repository->findOneByUsername('s-admin'); |
188 |
|
|
189 |
|
$userIds = array($userDemo->geTId(), $userSAdmin->getId()); |
190 |
|
|
191 |
|
$this->repository->removeUsers($userIds); |
192 |
|
$this->assertNull($this->repository->findOneByUsername('demo')); |
193 |
|
$this->assertNull($this->repository->findOneByUsername('s-admin')); |
194 |
|
|
195 |
|
$dm->persist(clone $userDemo); |
196 |
|
$dm->persist(clone $userSAdmin); |
197 |
|
$dm->flush(); |
198 |
|
} |
199 |
|
|
200 |
|
/** |
201 |
|
* Test remove users |
src/OpenOrchestra/Tests/Functional/MediaAdminBundle/Repository/MediaRepositoryTest.php 1 location
|
@@ 155-170 (lines=16) @@
|
152 |
|
/** |
153 |
|
* Test remove medias |
154 |
|
*/ |
155 |
|
public function testRemoveMedias() |
156 |
|
{ |
157 |
|
$dm = static::$kernel->getContainer()->get('object_manager'); |
158 |
|
$image01 = $this->repository->findOneByName('Image 01'); |
159 |
|
$image02 = $this->repository->findOneByName('Image 02'); |
160 |
|
|
161 |
|
$mediaIds = array($image01->getId(), $image02->getId()); |
162 |
|
|
163 |
|
$this->repository->removeMedias($mediaIds); |
164 |
|
$this->assertNull($this->repository->findOneByName('Image 01')); |
165 |
|
$this->assertNull($this->repository->findOneByName('Image 02')); |
166 |
|
|
167 |
|
$dm->persist(clone $image01); |
168 |
|
$dm->persist(clone $image02); |
169 |
|
$dm->flush(); |
170 |
|
} |
171 |
|
} |
172 |
|
|