Closed
Description
I want to implement this method in my testcase:
class BaseTestCase extends \PHPUnit\Framework\TestCase
{
/**
* @template T of object
*
* @param class-string<T> $class
*
* @return T
*/
protected function fetch(string $class): object
{
$message = $this->fetch(); // returns object of unknown class
$this->assertInstanceOf($class, $message, 'Message is not of the expected type');
return $firstMessage;
}
}
but this doesn't seem to work.
Metadata
Metadata
Assignees
Labels
No labels