public function testRenderServices() { $generator = new Generator(); $parser = new LaravelRouteParser(); $this->assertContains('GET', $parser->getMethodsByController('AngieTest2Controller')); $this->assertContains('POST', $parser->getMethodsByController('AngieTest2Controller')); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'testApplicationServices') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'testApplicationServices') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'var postURL="test"') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'AngieTest2ControllerService') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'var postURL="test2"') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'TestAngieTestController4Service') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'TestAngieTestController5Service') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'listURL="angie/test/:test"') !== FALSE); $this->assertTrue(strpos($generator->renderServices('testApplication'), 'listURL="test3/:test3/edit"') === FALSE); $this->assertContains('GET', $parser->getMethodsByController('AngieTestController1')); $this->assertContains('POST', $parser->getMethodsByController('AngieTestController1')); $this->assertContains('DELETE', $parser->getMethodsByController('AngieTestController1')); $this->assertContains('PUT', $parser->getMethodsByController('AngieTestController1')); }
<?php use Moszkva\Angie\Generator; Route::get('angie/get/routing', function () { $generator = new Generator(); $generator->renderRouterProviderStatment($appName); }); Route::get('angie/get/services', function () { $generator = new Generator(); $generator->renderRouterProviderStatment($appName); });