Skip to content
Permalink
Browse files

fixing up some broken tests

  • Loading branch information...
gwoo
gwoo committed Jul 20, 2009
1 parent f14a223 commit 0935eb04773ce4055c782114bf71aa516bb9b740
@@ -235,6 +235,11 @@ class ScaffoldViewTest extends CakeTestCase {
*/
function setUp() {
$this->Controller =& new ScaffoldMockController();
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
}
/**
* tearDown method
@@ -244,6 +249,8 @@ function setUp() {
*/
function tearDown() {
unset($this->Controller);
App::build();
}
/**
* testGetViewFilename method
@@ -293,13 +300,6 @@ function testGetViewFilename() {
$expected = 'cake' . DS . 'libs' . DS . 'view' . DS . 'errors' . DS . 'scaffold_error.ctp';
$this->assertEqual($result, $expected);
$_back = array(
'viewPaths' => Configure::read('viewPaths'),
'pluginPaths' => Configure::read('pluginPaths'),
);
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS));
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS));
$Controller =& new ScaffoldMockController();
$Controller->scaffold = 'admin';
$Controller->viewPath = 'posts';
@@ -329,8 +329,6 @@ function testGetViewFilename() {
. DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.edit.ctp';
$this->assertEqual($result, $expected);
Configure::write('viewPaths', $_back['viewPaths']);
Configure::write('pluginPaths', $_back['pluginPaths']);
Configure::write('Routing.admin', $_admin);
}
/**
@@ -40,7 +40,7 @@ class I18nTest extends CakeTestCase {
*/
function setUp() {
App::build(array(
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale'),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins')
));
}
@@ -159,6 +159,18 @@ function tearDown() {
unset($this->PostsController);
unset($this->Controller);
}
/**
* startTest
*
* @access public
* @return void
*/
function startTest() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
}
/**
* endTest
*
@@ -182,11 +194,6 @@ function testPluginGetTemplate() {
$this->Controller->theme = 'test_plugin_theme';
$ThemeView = new TestThemeView($this->Controller);
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'themed' . DS . 'test_plugin_theme' . DS .'tests' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('index');
$this->assertEqual($result, $expected);
@@ -210,12 +217,6 @@ function testGetTemplate() {
$ThemeView = new TestThemeView($this->Controller);
$ThemeView->theme = 'test_theme';
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
$result = $ThemeView->getViewFileName('home');
$this->assertEqual($result, $expected);

0 comments on commit 0935eb0

Please sign in to comment.
You can’t perform that action at this time.