paths = [ new PathItem(['path' => '/comments']), new PathItem(['path' => '/comments']), ]; $analysis = new Analysis([$openapi], new Context()); $analysis->openapi = $openapi; $analysis->process(new BuildPaths()); $this->assertCount(1, $openapi->paths); $this->assertSame('/comments', $openapi->paths[0]->path); } public function testMergeOperationsWithSamePath() { $openapi = new OpenApi([]); $analysis = new Analysis( [ $openapi, new Get(['path' => '/comments']), new Post(['path' => '/comments']), ], new Context() ); $analysis->process(new MergeIntoOpenApi()); $analysis->process(new BuildPaths()); $this->assertCount(1, $openapi->paths); $path = $openapi->paths[0]; $this->assertSame('/comments', $path->path); $this->assertInstanceOf(PathItem::class, $path); $this->assertInstanceOf(Get::class, $path->get); $this->assertInstanceOf(Post::class, $path->post); $this->assertSame(Generator::UNDEFINED, $path->put); } }