예제 #1
0
 /**
  * test that plugin/$plugin_name is only appended to the paths it should be.
  *
  * @return void
  */
 function testPluginPathGeneration()
 {
     $this->Controller->plugin = 'test_plugin';
     $this->Controller->name = 'TestPlugin';
     $this->Controller->viewPath = 'tests';
     $this->Controller->action = 'index';
     $View = new TestView($this->Controller);
     $paths = $View->paths();
     $this->assertEqual($paths, App::path('views'));
     $paths = $View->paths('test_plugin');
     $expected = array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS, TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS, TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS);
     $this->assertEqual($paths, $expected);
 }
예제 #2
0
 /**
  * Test that plugin/$plugin_name is only appended to the paths it should be.
  *
  * @return void
  */
 public function testPluginPathGeneration()
 {
     $this->Controller->plugin = 'TestPlugin';
     $this->Controller->name = 'TestPlugin';
     $this->Controller->viewPath = 'Tests';
     $this->Controller->action = 'index';
     $View = new TestView($this->Controller);
     $paths = $View->paths();
     $expected = array_merge(App::path('View'), App::core('View'), App::core('Console/Templates/skel/View'));
     $this->assertEquals($expected, $paths);
     $paths = $View->paths('TestPlugin');
     $pluginPath = CakePlugin::path('TestPlugin');
     $expected = array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugin' . DS . 'TestPlugin' . DS, $pluginPath . 'View' . DS, CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS, CAKE . 'View' . DS, CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS);
     $this->assertEquals($expected, $paths);
 }
예제 #3
0
파일: ViewTest.php 프로젝트: Nervie/Beta
 /**
  * test that plugin/$plugin_name is only appended to the paths it should be.
  *
  * @return void
  */
 public function testPluginPathGeneration()
 {
     $this->Controller->plugin = 'TestPlugin';
     $this->Controller->name = 'TestPlugin';
     $this->Controller->viewPath = 'Tests';
     $this->Controller->action = 'index';
     $View = new TestView($this->Controller);
     $paths = $View->paths();
     $expected = array_merge(App::path('View'), App::core('View'));
     $this->assertEqual($paths, $expected);
     $paths = $View->paths('TestPlugin');
     $pluginPath = CakePlugin::path('TestPlugin');
     $expected = array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugins' . DS . 'TestPlugin' . DS, $pluginPath . 'View' . DS, $pluginPath . 'views' . DS, $pluginPath . 'Lib' . DS . 'View' . DS, CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS, CAKE . 'View' . DS);
     $this->assertEqual($paths, $expected);
 }