Пример #1
0
 /**
  * Test prg method (post: overloaded form name)
  *
  * @return void
  */
 public function testPrgPostWithOtherFormName()
 {
     unset($this->Controller);
     $_SERVER['REQUEST_METHOD'] = 'POST';
     $request = new Request(['webroot' => '/dir/', 'params' => ['action' => 'index', 'pass' => []], 'post' => ['Article' => ['title' => 'first']]]);
     $response = new Response();
     $this->Controller = $this->getMock('PlumSearch\\Test\\App\\Controller\\ArticlesController', ['redirect'], [$request, $response, 'Articles']);
     $redirectExpectation = ['?' => ['title' => 'first'], 'action' => 'index'];
     $this->Controller->expects($this->once())->method('redirect')->with($redirectExpectation)->will($this->returnValue($this->Controller->response));
     $this->Controller->Filter->prg($this->Controller->Articles);
 }