Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function setUp()
- {
- $this->controller = new IdeaController();
- $this->request = new Request();
- $this->routeMatch = new RouteMatch(array('controller' => 'idea'));
- $this->event = new MvcEvent();
- $this->event->setRouteMatch($this->routeMatch);
- $this->controller->setEvent($this->event);
- $this->controller->setServiceLocator(Bootstrap::getServiceManager());
- $this->routeMatch->setMatchedRouteName('restful');
- }
- public function testCreate() {
- $parameters = new Parameters(array('name'=>'A'));
- $this->request->setMethod('POST')
- ->setPost($parameters);
- $result = $this->controller->dispatch($this->request);
- $response = $this->controller->getResponse();
- $this->assertEquals(403, $response->getStatusCode());
- $this->assertArrayHasKey('id', $result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement