* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class PhpTest extends GeneratorTestCase { public function testGenerate() { $generator = new Php('http://api.foo.com'); $result = $generator->generate($this->getSpecification()); $target = __DIR__ . '/resource/php'; $this->writeChunksToFolder($result, $target); $this->assertFileExists($target . '/Client.php'); $this->assertFileExists($target . '/Entry.php'); $this->assertFileExists($target . '/EntryCollection.php'); $this->assertFileExists($target . '/EntryCreate.php'); $this->assertFileExists($target . '/EntryDelete.php'); $this->assertFileExists($target . '/EntryMessage.php'); $this->assertFileExists($target . '/EntryPatch.php'); $this->assertFileExists($target . '/EntryUpdate.php'); $this->assertFileExists($target . '/FooByNameAndTypeResource.php'); $this->assertFileExists($target . '/GetQuery.php'); $this->assertFileExists($target . '/Path.php'); } public function testGenerateCollection() { $generator = new Php('http://api.foo.com', 'Foo\Bar'); $result = $generator->generate($this->getSpecificationCollection()); $target = __DIR__ . '/resource/php_collection'; $this->writeChunksToFolder($result, $target); $this->assertFileExists($target . '/BarByFooResource.php'); $this->assertFileExists($target . '/BarByYearResource.php'); $this->assertFileExists($target . '/Client.php'); $this->assertFileExists($target . '/Entry.php'); $this->assertFileExists($target . '/EntryCollection.php'); $this->assertFileExists($target . '/EntryCreate.php'); $this->assertFileExists($target . '/EntryMessage.php'); $this->assertFileExists($target . '/FooResource.php'); $this->assertFileExists($target . '/PathFoo.php'); $this->assertFileExists($target . '/PathYear.php'); } public function testGenerateComplex() { $generator = new Php('http://api.foo.com', 'Foo\Bar'); $result = $generator->generate($this->getSpecificationComplex()); $target = __DIR__ . '/resource/php_complex'; $this->writeChunksToFolder($result, $target); $this->assertFileExists($target . '/Client.php'); $this->assertFileExists($target . '/Entry.php'); $this->assertFileExists($target . '/EntryMessage.php'); $this->assertFileExists($target . '/FooByNameAndTypeResource.php'); $this->assertFileExists($target . '/Path.php'); } } __halt_compiler();----SIGNATURE:----kV8d4mJsRy10Gqi9PS3coaZ4DLSnS2NkvK08v7LfyAlvSV9EXa5Di1WhkVbVKXKgw1733w9rTD2GedicnZWRU5i76+xqL1xwq/YFWZbOWxvgQqjKZXkiY+XvJYTlKYSdAAL5dpiu5sYDzkDvcb10Yk60tJcOQopZF3oaAdpskuf2AubXBlJgDFL4oeWzDZUd8X7A6MfvZ2BdU1Yg7rITOBJG8ApjH+0mIROaJ+xqSgPvGFZJ0mFLZEdSnIIIfOWlI18c40ZxpTshX1ngrVxfxOsoMA8BMv0l7DiEAYtCqqzoum3XpnfMzDF7rP2PVUEHZZJyZPlxixff5I96iPR9XubzZgbtHuAFfb54PZ3zMNT1dB3OkE+VGPd5Y0GyacYoB0VMVCYYoqnprIzy1Xm7wQuSddkoHs/K6K3lqAVLXvESdHjzD9yMyQ4rul5A8so0e63zsOb67Ssz5p6rvts5rwdOPOqPpd3FnmLe+YWe14vTlo95Wz7Fqzwbl77dT0eNl/Bj2IL6ib8Sa+nQI9D8R+WLueZApEH2MUs1LKZUiUKHHswcw0OQOell7SWCrAYnH84Ds7TAjVsv2lI8hdgaTbsMa0Irw+2hsHew0o2OZTXc5EmlFLTQG5R5bCeINcgGNE3YHnAzEjoEfvnp7RJt9KVyld5oa6kE6c9aC5/bmvg=----ATTACHMENT:----Mjk1Mzc2MDYwMDIyNjUzNyAyNjA5NzUwMDcwMTE3MzkyIDgyMDM4NTk4MzMxNTg0Njg=