$expected is the first arg for assertEqual

having it the wrong way round makes the error messages quite confusing
This commit is contained in:
AD7six 2011-05-17 00:20:59 +02:00
parent e95d6a3b10
commit 6b77e73c49

View file

@ -234,11 +234,11 @@ class ViewTest extends CakeTestCase {
$expected = CakePlugin::path('TestPlugin') . 'View' . DS .'Tests' . DS .'index.ctp'; $expected = CakePlugin::path('TestPlugin') . 'View' . DS .'Tests' . DS .'index.ctp';
$result = $View->getViewFileName('index'); $result = $View->getViewFileName('index');
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
$expected = CakePlugin::path('TestPlugin') . 'View' . DS . 'Layouts' . DS .'default.ctp'; $expected = CakePlugin::path('TestPlugin') . 'View' . DS . 'Layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName(); $result = $View->getLayoutFileName();
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
} }
/** /**
@ -290,11 +290,11 @@ class ViewTest extends CakeTestCase {
$pluginPath = CakePlugin::path('TestPlugin'); $pluginPath = CakePlugin::path('TestPlugin');
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS .'TestPlugin' . DS . 'View' . DS .'Tests' . DS .'index.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS .'TestPlugin' . DS . 'View' . DS .'Tests' . DS .'index.ctp';
$result = $View->getViewFileName('index'); $result = $View->getViewFileName('index');
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
$expected = $pluginPath. 'View' . DS . 'Layouts' . DS .'default.ctp'; $expected = $pluginPath. 'View' . DS . 'Layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName(); $result = $View->getLayoutFileName();
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
} }
/** /**
@ -314,30 +314,30 @@ class ViewTest extends CakeTestCase {
$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 = $View->getViewFileName('home'); $result = $View->getViewFileName('home');
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
$result = $View->getViewFileName('/Posts/index'); $result = $View->getViewFileName('/Posts/index');
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
$result = $View->getViewFileName('../Posts/index'); $result = $View->getViewFileName('../Posts/index');
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS .'default.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName(); $result = $View->getLayoutFileName();
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
$View->layoutPath = 'rss'; $View->layoutPath = 'rss';
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'rss' . DS . 'default.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'rss' . DS . 'default.ctp';
$result = $View->getLayoutFileName(); $result = $View->getLayoutFileName();
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
$View->layoutPath = 'emails' . DS . 'html'; $View->layoutPath = 'emails' . DS . 'html';
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp';
$result = $View->getLayoutFileName(); $result = $View->getLayoutFileName();
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
} }
/** /**
@ -764,7 +764,7 @@ class ViewTest extends CakeTestCase {
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp'; $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
$result = $View->getViewFileName('../Posts/index'); $result = $View->getViewFileName('../Posts/index');
$this->assertEqual($result, $expected); $this->assertEqual($expected, $result);
} }