GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — PhpStan does not consider usage of Phpunit Assert::assertNotEmpty and Assert::assertContainsOnlyInstancesOf when returning an Array · Issue #158 · phpstan/phpstan-phpunit Open DescriptionHello, I am building a test returning an array of entities to be used in some others tests marked with /** * @return Post[] * * @throws \Exception */ public function testFindForHomePageReturnsCollectionOfPosts(): array { $testSubject = self::getContainer()->get(PostRepository::class); if (!$testSubject instanceof PostRepository) { throw new ServiceNotFoundException(PostRepository::class); } $result = $testSubject->findForHomePage()->toArray(); self::assertNotEmpty($result); self::assertContainsOnlyInstancesOf(Post::class, $result); return $result; } And the alert thrown by phpstan (line 34 is the Context:Symfony 6.2 KernelTestCase PhpStan 1.9.3
Thanks a lot for your help :) ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |