* @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:----Cu/Yet2imfSUod/Ib1UJizWnqCrIGupnzsenqAuo7XHUT2JCYSK7LbU4dkcOhFgWYCLw9Hnre/gmRtNuwHJ7oMCoBlfT/Wfke1i1U+FbPX0lbWCTuhTQArB1sKIP6WEx5O517t8G0OGbt4ni8HVceEVNePqdCLzrMvvkNZ5m98SDA7U9RaBq7LxErFgBC+mZAEvecZVYy8CtIPaiIvqZLPg4vWaGQzjFhdyxoyzQpmRCN9pdYkPIaXuCTa6v/WOguSAy9kMe9WyAnrpymE83BiYURdkLW+7xNerMmwBbNek0CVBn/h88mTNOlSfBrGdDbYUX6kNNJe+3TVW0ArlIB+CiyigzCv2nPuc7xWe8XHbfV6B+DkTzS4iuGmLpFFPzCdtnU6iLVnr3g5K21WHHGrXvtPV1epy3mN0CEhCNdDVhYWL/ma8haceDVxSeWY7GoBQObg0HhUsaVHfTb6LeiXd15ZhO2G2vT69YnDV3lenEi3WsVUw1bfsbYYNLcvU3Xc8ws8nG8ef9mJeMjorkIgkP4j2FNCgoPfI+GMoPYPLi/cmyFG6DpbUEaBqmZp6qUkiQnImxzEbHRj5Umo2jAQzNBB2bMpzCBxB7ylPZAZdoXlJij5brJceDNmSBAQszHuxD61+kSqzbgNpIoXO4V/l/8DYurPkc6WKmgVyqj/0=----ATTACHMENT:----NTEwMTkxOTYwNTM0MzE3NCAyNjY4NDEzOTk4ODUyNTEzIDIwOTE1MzQ4NzQ1MjkyMzU=