* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class TypescriptTest extends GeneratorTestCase { public function testGenerate() { $generator = new Typescript('http://api.foo.com'); $result = $generator->generate($this->getSpecification()); $target = __DIR__ . '/resource/typescript'; $this->writeChunksToFolder($result, $target); $this->assertFileExists($target . '/Client.ts'); $this->assertFileExists($target . '/Entry.ts'); $this->assertFileExists($target . '/EntryCollection.ts'); $this->assertFileExists($target . '/EntryCreate.ts'); $this->assertFileExists($target . '/EntryDelete.ts'); $this->assertFileExists($target . '/EntryMessage.ts'); $this->assertFileExists($target . '/EntryPatch.ts'); $this->assertFileExists($target . '/EntryUpdate.ts'); $this->assertFileExists($target . '/FooByNameAndTypeResource.ts'); $this->assertFileExists($target . '/GetQuery.ts'); $this->assertFileExists($target . '/Path.ts'); } public function testGenerateCollection() { $generator = new Typescript('http://api.foo.com'); $result = $generator->generate($this->getSpecificationCollection()); $target = __DIR__ . '/resource/typescript_collection'; $this->writeChunksToFolder($result, $target); $this->assertFileExists($target . '/BarByFooResource.ts'); $this->assertFileExists($target . '/BarByYearResource.ts'); $this->assertFileExists($target . '/Client.ts'); $this->assertFileExists($target . '/Entry.ts'); $this->assertFileExists($target . '/EntryCollection.ts'); $this->assertFileExists($target . '/EntryCreate.ts'); $this->assertFileExists($target . '/EntryMessage.ts'); $this->assertFileExists($target . '/FooResource.ts'); $this->assertFileExists($target . '/PathFoo.ts'); $this->assertFileExists($target . '/PathYear.ts'); } public function testGenerateComplex() { $generator = new Typescript('http://api.foo.com'); $result = $generator->generate($this->getSpecificationComplex()); $target = __DIR__ . '/resource/typescript_complex'; $this->writeChunksToFolder($result, $target); $this->assertFileExists($target . '/Client.ts'); $this->assertFileExists($target . '/Entry.ts'); $this->assertFileExists($target . '/EntryMessage.ts'); $this->assertFileExists($target . '/EntryOrMessage.ts'); $this->assertFileExists($target . '/FooByNameAndTypeResource.ts'); $this->assertFileExists($target . '/Path.ts'); } } __halt_compiler();----SIGNATURE:----GCJSAhFW6d+RZJQe2ojfHvDT2BAydYZBn5lA8/Hrv1um8ICxL/qniYusxiZmdRU3N8EBA4ZS4xrifHGFoMrc2s6xnTDrHVgUyH3g/GPmznaNeGHshNsbjzGsW5oEfDricAdfM4Go0ZxV/2jtS1tqPv2SZ6jp+KkL2NwN9DYfh2yJMDoeXCiYGwdJFFf+rthLcXKaodGff5nEC4jer+wXH5QUXQ0rxG/EGDB3PW6u+N3kcL4d/ZXufnyuiPR1RTGVTwp6I3e62HROJsC2K8+Qytm4Ms9Yy2sWR3P+aaeBklh9qliv+aYYi8b9KUqaOmIIN36r+tRHYo1/rCySVgtFaTvj/9SKtIX9tqT9GXDs7yi/isrkDx7ZE5k39NEEyDccktr39PJZrP3P/mtru4LST33zuNpcnr+T9I97g4C+saIcGkX5f/S7Iat1AfNeZx9qV/tnFHOEO1IySD5Kvgw8Fz0YclaEOPGO4ngxaE7Bup/LsEyM2C29CEykFRl9O/o5QeQYOWQ3m17q4UGdX0p5rWkH5vKurAuayhpJ3+yAQQA8X0gG+AuHzVRZjNkDB/8rCzUivsyMiV4eGj8VzkWIWFj+x1UEYIZeS2ytdeLVdd02NMuMLume77mTEWSmpfqAYSEZpUzl+2ufmYd0QD2Lp7lzZnmlCciuuY+EyfW+Kpo=----ATTACHMENT:----NzY5NjI1NzM0MDkzMTk0MCAyOTc4MjI3Mjc1NDgxMDU0IDU3ODc3NTE3MDU1NTQ3MjU=