Exemplo n.º 1
0
 /**
  * Test for missing layouts
  *
  * @expectedException \Cake\View\Exception\MissingLayoutException
  * @return void
  */
 public function testMissingLayout()
 {
     $viewOptions = ['plugin' => null, 'name' => 'Pages', 'viewPath' => 'Pages', 'layout' => 'whatever'];
     $View = new TestView(null, null, null, $viewOptions);
     $View->getLayoutFileName();
 }
 /**
  * Test that themed plugin paths are generated correctly.
  *
  * @return void
  */
 public function testPathThemedPluginGeneration()
 {
     $viewOptions = ['plugin' => 'TestPlugin', 'name' => 'TestPlugin', 'viewPath' => 'Tests', 'view' => 'index', 'theme' => 'TestTheme'];
     $View = new TestView(null, null, null, $viewOptions);
     $paths = $View->paths('TestPlugin');
     $pluginPath = Plugin::path('TestPlugin');
     $themePath = Plugin::path('TestTheme');
     $expected = [TEST_APP . APP_DIR . DS . 'Template' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS, TEST_APP . APP_DIR . DS . 'Template' . DS . 'TestTheme' . DS, $themePath . 'src' . DS . 'Template' . DS . 'Plugin' . DS . 'TestPlugin' . DS, $themePath . 'src' . DS . 'Template' . DS, TEST_APP . APP_DIR . DS . 'Template' . DS . 'Plugin' . DS . 'TestPlugin' . DS, $pluginPath . 'src' . DS . 'Template' . DS, TEST_APP . APP_DIR . DS . 'Template' . DS, CAKE . 'Template' . DS];
     $this->assertPathEquals($expected, $paths);
 }