Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 53486da

Browse files
committed
Added shortcut method to find all entities
1 parent c2d90d6 commit 53486da

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

psalm.baseline.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,15 @@
181181
<file src="src/Test/Controller/NewActionTestCase.php">
182182
<InvalidReturnStatement>
183183
<code><![CDATA[$entity]]></code>
184+
<code><![CDATA[$this->findAllEntities($this->controllerUnderTest()::getEntityFqcn())]]></code>
184185
<code><![CDATA[$this->findEntity(
185186
$this->controllerUnderTest()::getEntityFqcn(),
186187
$id,
187188
)]]></code>
188189
</InvalidReturnStatement>
189190
<InvalidReturnType>
190191
<code><![CDATA[TEntity]]></code>
192+
<code><![CDATA[iterable<TEntity>]]></code>
191193
</InvalidReturnType>
192194
</file>
193195
<file src="src/Translation/EasyAdminTranslationMessage.php">

src/Test/Controller/NewActionTestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ protected function findEntityForControllerUnderTest(int|string|object $id): obje
196196
);
197197
}
198198

199+
/** @return iterable<TEntity> */
200+
protected function findAllEntitiesForControllerUnderTest(): iterable
201+
{
202+
return $this->findAllEntities($this->controllerUnderTest()::getEntityFqcn());
203+
}
204+
199205
/** @return TEntity */
200206
protected function getEntityForControllerUnderTest(int|string|object $id): object
201207
{

0 commit comments

Comments
 (0)