src/OpenOrchestra/Tests/Functional/ModelBundle/Repository/StatustRepositoryTest.php 1 location
|
@@ 120-135 (lines=16) @@
|
117 |
|
/** |
118 |
|
* Test remove statuses |
119 |
|
*/ |
120 |
|
public function testRemoveStatuses() |
121 |
|
{ |
122 |
|
$dm = static::$kernel->getContainer()->get('object_manager'); |
123 |
|
$statusPending = $this->repository->findOneByName('pending'); |
124 |
|
$statusPublished = $this->repository->findOneByName('published'); |
125 |
|
|
126 |
|
$statusIds = array($statusPending->getId(), $statusPublished->getId()); |
127 |
|
|
128 |
|
$this->repository->removeStatuses($statusIds); |
129 |
|
$this->assertNull($this->repository->findOneByName('pending')); |
130 |
|
$this->assertNull($this->repository->findOneByName('published')); |
131 |
|
|
132 |
|
$dm->persist(clone $statusPending); |
133 |
|
$dm->persist(clone $statusPublished); |
134 |
|
$dm->flush(); |
135 |
|
} |
136 |
|
} |
137 |
|
|
src/OpenOrchestra/Tests/Functional/UserAdminBundle/Repository/UserRepositoryTest.php 1 location
|
@@ 208-223 (lines=16) @@
|
205 |
|
/** |
206 |
|
* Test remove users |
207 |
|
*/ |
208 |
|
public function testRemoveUsers() |
209 |
|
{ |
210 |
|
$dm = static::$kernel->getContainer()->get('object_manager'); |
211 |
|
$userDemo = $this->repository->findOneByUsername('demo'); |
212 |
|
$userSAdmin = $this->repository->findOneByUsername('s-admin'); |
213 |
|
|
214 |
|
$userIds = array($userDemo->geTId(), $userSAdmin->getId()); |
215 |
|
|
216 |
|
$this->repository->removeUsers($userIds); |
217 |
|
$this->assertNull($this->repository->findOneByUsername('demo')); |
218 |
|
$this->assertNull($this->repository->findOneByUsername('s-admin')); |
219 |
|
|
220 |
|
$dm->persist(clone $userDemo); |
221 |
|
$dm->persist(clone $userSAdmin); |
222 |
|
$dm->flush(); |
223 |
|
} |
224 |
|
|
225 |
|
/** |
226 |
|
* Test remove users |
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/MediaAdminBundle/Repository/MediaRepositoryTest.php 1 location
|
@@ 144-159 (lines=16) @@
|
141 |
|
/** |
142 |
|
* Test remove medias |
143 |
|
*/ |
144 |
|
public function testRemoveMedias() |
145 |
|
{ |
146 |
|
$dm = static::$kernel->getContainer()->get('object_manager'); |
147 |
|
$image01 = $this->repository->findOneByName('Image 01'); |
148 |
|
$image02 = $this->repository->findOneByName('Image 02'); |
149 |
|
|
150 |
|
$mediaIds = array($image01->getId(), $image02->getId()); |
151 |
|
|
152 |
|
$this->repository->removeMedias($mediaIds); |
153 |
|
$this->assertNull($this->repository->findOneByName('Image 01')); |
154 |
|
$this->assertNull($this->repository->findOneByName('Image 02')); |
155 |
|
|
156 |
|
$dm->persist(clone $image01); |
157 |
|
$dm->persist(clone $image02); |
158 |
|
$dm->flush(); |
159 |
|
} |
160 |
|
} |
161 |
|
|