normalizer->expects($this->once()) ->method('normalize') ->with($this->documentation) ->willReturn(['info' => ['title' => 'My Test App']]); $expectedApi = new OpenApi(['info' => ['title' => 'My Test App']]); $this->assertEquals($expectedApi->toJson(), $this->getOpenApiDoc()->toJson()); } public function testDescribeRemovesBasePathAfterNormalization() { $this->normalizer->expects($this->once()) ->method('normalize') ->with($this->documentation) ->willReturn(['info' => ['title' => 'My Test App'], 'basePath' => '/foo']); $expectedApi = new OpenApi(['info' => ['title' => 'My Test App']]); $this->assertEquals($expectedApi->toJson(), $this->getOpenApiDoc()->toJson()); } protected function setUp(): void { $this->documentation = new Documentation(new ResourceNameCollection(['dummy' => 'dummy'])); $this->normalizer = $this->createMock(NormalizerInterface::class); $this->normalizer->expects($this->once()) ->method('supportsNormalization') ->willReturn(true); $this->describer = new ApiPlatformDescriber($this->documentation, $this->normalizer); } }