phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

WebTestCase collector not special-casing return

Open simon-tma opened this issue 6 years ago • 1 comments

The collector for a test client in functional tests isn't using the argument to map to the actual return type, leading to false positives.

    $client = static::createClient();

    $client->enableProfiler();
    $client->request('POST', '/api/1/company);
    $this->assertSame(
      0,
      $client->getProfile()->getCollector('swiftmailer')->getMessageCount()
    );

This results in:

Call to an undefined method Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface::getMessageCount()

simon-tma avatar Feb 28 '19 22:02 simon-tma

Thanks, I'll look into it.

lookyman avatar Mar 04 '19 14:03 lookyman