wrapper = new class { use StringWrapper; }; } public function testString() { $str = $this->wrapper->string('foo'); $this->assertInstanceOf(StringType::class, $str); } }