Пример #1
0
 public function testGetMethodsByController()
 {
     $parser = new LaravelRouteParser();
     $this->assertContains('GET', $parser->getMethodsByController('AngieTestController'));
     $this->assertContains('POST', $parser->getMethodsByController('AngieTestController'));
     $this->assertContains('DELETE', $parser->getMethodsByController('AngieTestController'));
     $this->assertContains('PUT', $parser->getMethodsByController('AngieTestController'));
 }
Пример #2
0
 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'));
 }