Update test.

Add fixtures so app tables aren't touched.
Replace construction with method calls.
This commit is contained in:
mark_story 2011-11-12 21:00:42 -05:00
parent 2c7854cc2f
commit 17ffcde505

View file

@ -170,6 +170,13 @@ class TestAfterHelper extends Helper {
*/
class ViewTest extends CakeTestCase {
/**
* Fixtures used in this test.
*
* @var array
*/
public $fixtures = array('core.user', 'core.post');
/**
* setUp method
*
@ -576,14 +583,14 @@ class ViewTest extends CakeTestCase {
$View->Helpers = $this->getMock('HelperCollection', array('trigger'), array($View));
$View->Helpers->expects($this->at(0))->method('trigger')
->with('beforeRender', new PHPUnit_Framework_Constraint_IsAnything());
->with('beforeRender', $this->anything());
$View->Helpers->expects($this->at(1))->method('trigger')
->with('afterRender', new PHPUnit_Framework_Constraint_IsAnything());
->with('afterRender', $this->anything());
$View->Helpers->expects($this->at(2))->method('trigger')
->with('beforeLayout', new PHPUnit_Framework_Constraint_IsAnything());
->with('beforeLayout', $this->anything());
$View->Helpers->expects($this->at(3))->method('trigger')
->with('afterLayout', new PHPUnit_Framework_Constraint_IsAnything());
->with('afterLayout', $this->anything());
$View->render('index');
}