Avoiding class name conflicts

This commit is contained in:
Jose Lorenzo Rodriguez 2012-01-22 16:46:41 -04:30
parent 5cc2860c41
commit 9d0a67ddec

View file

@ -22,11 +22,11 @@ App::uses('Controller', 'Controller');
/** /**
* ThemePostsController class * ThemePosts2Controller class
* *
* @package Cake.Test.Case.View * @package Cake.Test.Case.View
*/ */
class ThemePostsController extends Controller { class ThemePosts2Controller extends Controller {
/** /**
* name property * name property
@ -51,11 +51,11 @@ class ThemePostsController extends Controller {
} }
/** /**
* TestThemeView class * TestTheme2View class
* *
* @package Cake.Test.Case.View * @package Cake.Test.Case.View
*/ */
class TestThemeView extends ThemeView { class TestTheme2View extends ThemeView {
/** /**
* renderElement method * renderElement method
@ -106,7 +106,7 @@ class ThemeViewTest extends CakeTestCase {
parent::setUp(); parent::setUp();
$request = new CakeRequest('posts/index'); $request = new CakeRequest('posts/index');
$this->Controller = new Controller($request); $this->Controller = new Controller($request);
$this->PostsController = new ThemePostsController($request); $this->PostsController = new ThemePosts2Controller($request);
$this->PostsController->viewPath = 'posts'; $this->PostsController->viewPath = 'posts';
$this->PostsController->index(); $this->PostsController->index();
$this->ThemeView = new ThemeView($this->PostsController); $this->ThemeView = new ThemeView($this->PostsController);
@ -143,7 +143,7 @@ class ThemeViewTest extends CakeTestCase {
$this->Controller->action = 'index'; $this->Controller->action = 'index';
$this->Controller->theme = 'TestTheme'; $this->Controller->theme = 'TestTheme';
$ThemeView = new TestThemeView($this->Controller); $ThemeView = new TestTheme2View($this->Controller);
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('index'); $result = $ThemeView->getViewFileName('index');
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
@ -169,7 +169,7 @@ class ThemeViewTest extends CakeTestCase {
$this->Controller->action = 'display'; $this->Controller->action = 'display';
$this->Controller->params['pass'] = array('home'); $this->Controller->params['pass'] = array('home');
$ThemeView = new TestThemeView($this->Controller); $ThemeView = new TestTheme2View($this->Controller);
$ThemeView->theme = 'TestTheme'; $ThemeView->theme = 'TestTheme';
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
$result = $ThemeView->getViewFileName('home'); $result = $ThemeView->getViewFileName('home');
@ -209,7 +209,7 @@ class ThemeViewTest extends CakeTestCase {
$this->Controller->params['pass'] = array('home'); $this->Controller->params['pass'] = array('home');
$View = new TestThemeView($this->Controller); $View = new TestTheme2View($this->Controller);
ob_start(); ob_start();
$result = $View->getViewFileName('does_not_exist'); $result = $View->getViewFileName('does_not_exist');
$expected = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean()); $expected = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean());
@ -230,7 +230,7 @@ class ThemeViewTest extends CakeTestCase {
$this->Controller->layout = 'whatever'; $this->Controller->layout = 'whatever';
$this->Controller->theme = 'my_theme'; $this->Controller->theme = 'my_theme';
$View = new TestThemeView($this->Controller); $View = new TestTheme2View($this->Controller);
ob_start(); ob_start();
$result = $View->getLayoutFileName(); $result = $View->getLayoutFileName();
$expected = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean()); $expected = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean());