expectException(TypeError::class); $this->expectExceptionMessage('must be an object, int given'); std::object(42, StdObjectPolyfillBase::class); } public function testRejectsAnUnrelatedObject(): void { $this->expectException(TypeError::class); $this->expectExceptionMessage('must be an instance of StdObjectPolyfillBase, stdClass given'); std::object(new stdClass(), StdObjectPolyfillBase::class); } }