Skip to content

Commit a7d68c2

Browse files
committed
Add setConfigUseRepository method
1 parent d9488f1 commit a7d68c2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Functional/Command/Base/BaseFunctionalCommandTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ abstract class BaseFunctionalCommandTest extends WebTestCase
8888

8989
protected bool $useRequestStack = false;
9090

91+
protected bool $useRepository = false;
92+
9193
protected bool $useTranslator = false;
9294

9395
protected bool $loadFixtures = false;
@@ -193,6 +195,16 @@ protected function setConfigUseRequestStack(): self
193195
return $this;
194196
}
195197

198+
/**
199+
* @return self
200+
*/
201+
protected function setConfigUseRepository(): self
202+
{
203+
$this->useRepository = true;
204+
205+
return $this;
206+
}
207+
196208
/**
197209
* @return self
198210
*/
@@ -209,6 +221,7 @@ protected function setConfigUseTranslator(): self
209221
* @return void
210222
* @throws Exception
211223
* @SuppressWarnings(PHPMD.NPathComplexity)
224+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
212225
*/
213226
protected function setUp(): void
214227
{
@@ -240,6 +253,10 @@ protected function setUp(): void
240253
$this->createService(Environment::class);
241254
}
242255

256+
if ($this->useRepository) {
257+
$this->createService(Repository::class);
258+
}
259+
243260
if ($this->useRequestStack) {
244261
$this->createService(RequestStack::class);
245262
}

0 commit comments

Comments
 (0)