You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling createMock with multiple Types causes phpstan to report errors:
A class like
<?php declare(strict_types=1);
namespace App;
use PHPUnit\Framework\TestCase;
class Test extends TestCase
{
public function testDummy(): void {
$this->createMock([\DateTimeInterface::class, \ArrayAccess::class]);
}
}
throws the following errors:
------ -------------------------------------------------------------------------------------------------------------------------------------------------
Line Test.php
------ -------------------------------------------------------------------------------------------------------------------------------------------------
11 Parameter #1 $originalClassName of method PHPUnit\Framework\TestCase::createMock() expects class-string<mixed>, array<int, class-string> given.
11 Unable to resolve the template type T in call to method PHPUnit\Framework\TestCase::createMock()
------ -------------------------------------------------------------------------------------------------------------------------------------------------
The error also occurs, if there is only one class given, but not as a string, but as an array: $this->createMock([\DateTimeInterface::class]); produces the same error.
This is working fine in phpstan 0.11
The text was updated successfully, but these errors were encountered:
Calling
createMock
with multiple Types causes phpstan to report errors:A class like
throws the following errors:
The error also occurs, if there is only one class given, but not as a string, but as an array:
$this->createMock([\DateTimeInterface::class]);
produces the same error.This is working fine in phpstan 0.11
The text was updated successfully, but these errors were encountered: