/** * @expectedException \ApiPlatform\Core\Exception\ResourceClassNotFoundException * @expectedExceptionMessage The resource class "\DoNotExist" does not exist. */ public function testClassDoesNotExist() { $reader = $this->prophesize(Reader::class); $factory = new AnnotationPropertyNameCollectionFactory($reader->reveal()); $factory->create('\\DoNotExist'); }