'3.0.0', 'info' => [ 'title' => 'Test API', 'version' => '1.0.0', ], 'paths' => [], ], $merge)); } public function testWriteJson() { $openapi = $this->createOpenAPI(); $json = \cebe\openapi\Writer::writeToJson($openapi); $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI(); $openapi->paths['/test'] = new \cebe\openapi\spec\PathItem([ 'description' => 'something' ]); $json = \cebe\openapi\Writer::writeToJson($openapi); $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI(); $yaml = \cebe\openapi\Writer::writeToYaml($openapi); $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ 'security' => [], ]); $json = \cebe\openapi\Writer::writeToJson($openapi); $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ 'security' => [], ]); $yaml = \cebe\openapi\Writer::writeToYaml($openapi); $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ 'security' => [new SecurityRequirement(['Bearer' => []])], ]); $json = \cebe\openapi\Writer::writeToJson($openapi); $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ 'security' => [new SecurityRequirement(['Bearer' => []])], ]); $yaml = \cebe\openapi\Writer::writeToYaml($openapi); $this->assertEquals(preg_replace('~\R~', "\n", <<