Esempio n. 1
0
 /**
  * testMissingLayout method
  *
  * @access public
  * @return void
  */
 function testMissingLayout()
 {
     $this->Controller->plugin = null;
     $this->Controller->name = 'Posts';
     $this->Controller->viewPath = 'posts';
     $this->Controller->layout = 'whatever';
     $this->Controller->theme = 'my_theme';
     restore_error_handler();
     $View = new TestThemeView($this->Controller);
     ob_start();
     $result = $View->getLayoutFileName();
     $expected = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean());
     set_error_handler('simpleTestErrorHandler');
     $this->assertPattern("/Missing Layout/", $expected);
     $this->assertPattern("/views(\\/|\\\\)themed(\\/|\\\\)my_theme(\\/|\\\\)layouts(\\/|\\\\)whatever.ctp/", $expected);
 }
Esempio n. 2
0
 function testMissingLayout()
 {
     $this->Controller->plugin = null;
     $this->Controller->name = 'Posts';
     $this->Controller->viewPath = 'posts';
     $this->Controller->layout = 'whatever';
     $ThemeView = new TestThemeView($this->Controller);
     $expected = 'missingLayout';
     $result = $ThemeView->getLayoutFileName();
     $this->assertEqual($result, $expected);
 }
Esempio n. 3
0
 /**
  * Test for missing layouts
  *
  * @expectedException MissingLayoutException
  * @return void
  */
 public function testMissingLayout()
 {
     $this->Controller->plugin = null;
     $this->Controller->name = 'Posts';
     $this->Controller->viewPath = 'Posts';
     $this->Controller->layout = 'whatever';
     $View = new TestView($this->Controller);
     ob_start();
     $View->getLayoutFileName();
     ob_get_clean();
     $this->ThemeController->plugin = null;
     $this->ThemeController->name = 'Posts';
     $this->ThemeController->viewPath = 'posts';
     $this->ThemeController->layout = 'whatever';
     $this->ThemeController->theme = 'my_theme';
     $View = new TestThemeView($this->ThemeController);
     $View->getLayoutFileName();
 }
Esempio n. 4
0
 /**
  * testMissingLayout method
  *
  * @expectedException MissingLayoutException
  * @return void
  */
 public function testMissingLayout()
 {
     $this->Controller->plugin = null;
     $this->Controller->name = 'Posts';
     $this->Controller->viewPath = 'Posts';
     $this->Controller->layout = 'whatever';
     $View = new TestView($this->Controller);
     ob_start();
     $result = $View->getLayoutFileName();
     $expected = ob_get_clean();
     $this->ThemeController->plugin = null;
     $this->ThemeController->name = 'Posts';
     $this->ThemeController->viewPath = 'posts';
     $this->ThemeController->layout = 'whatever';
     $this->ThemeController->theme = 'my_theme';
     $View = new TestThemeView($this->ThemeController);
     ob_start();
     $result = $View->getLayoutFileName();
     $expected = ob_get_clean();
     $this->assertRegExp("/Missing Layout/", $expected);
     $this->assertRegExp("/views(\\/|\\\\)themed(\\/|\\\\)my_theme(\\/|\\\\)layouts(\\/|\\\\)whatever.ctp/", $expected);
 }