* @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:----NnelcTNEcLInkfhUM2CMSi2d5gUsoHp5NTtnmZcjZv0PTAR2IlOheRKZ5/wn5Wkk/S1SUnXz2yUtB0WmAjjHOubMroAGO5GjYZrX34HGGXwPt11zfCLg3YAoGQbIJgjgsDcbJ+esS8VR8S+hL1bSgENSrCrtQZQjJM83SwyabfM4lGYpOtyA9FVTyHatMUS80sF2bU6oyVyA2SAi1WyY2VJ25RbkhUM/MMc2SkZIJN+bXLdUbEEhCi7czVHQdy/X8+3Y+EgM4R3bWMyrdaXL5SE15sj9TpPXAHxgDCz8V+Eb/5x1LTM2lWBXRlqYxsrkmg8Ck2oP5m4clRoNno5cjbA5yHgGVhar5IzFs2SSSMdjAD7GDMonijOmYgGRAGccbQ/UQZ9WYOiDKYDCxNDKbL5lm+Ttka9aiY1RgVevxeUTACMmSKsWwQ8SG1GNURupRvgZ3NpyJm7yQUna51inGUtNRsYGTCIXuNECQR737pz1c6VeJhOKlxlP/wkgZhY5yiMLdf/loi2uYOrHwwNverUC+Mp+mO7fTfJG+S3CbqCEG0kmJXypXkPQKVE4uwQmtYXgkQbzDpS/E4fDAt1cdb8kU0Cz6+KUz/Vcbp+W0momzsNpgKzNnDCqKYKVky0FQTJ+cVF6cxoPE8BU+wBW8MvXl49Bfe6Uv1i77EcYh+g=----ATTACHMENT:----OTg5NjQ2Nzk1MTAyNzkyMiAyODE2NDQ0NTcyODgyNjE0IDY2MTQ3MzIwMjQyNjQzOTQ=