Exemplo n.º 1
0
 /**
  * Test that getLayoutFileName() protects against malicious directory traversal.
  *
  * @expectedException \InvalidArgumentException
  * @return void
  */
 public function testGetLayoutFileNameDirectoryTraversal()
 {
     $viewOptions = ['plugin' => null, 'name' => 'Pages', 'viewPath' => 'Pages'];
     $request = $this->getMock('Cake\\Network\\Request');
     $response = $this->getMock('Cake\\Network\\Response');
     $view = new TestView(null, null, null, $viewOptions);
     $view->ext('.php');
     $view->getLayoutFileName('../../../../bootstrap');
 }