Skip to content

Commit

Permalink
Adding two incomplete tests as they are not implemented. Pulling comp…
Browse files Browse the repository at this point in the history
…onent tests out of the controller test case.
  • Loading branch information
markstory committed Jun 12, 2010
1 parent 6955995 commit 2ec6f75
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions cake/tests/cases/libs/controller/component.test.php
Expand Up @@ -569,6 +569,54 @@ function testSomethingReferencingEmailComponent() {
));
}

/**
* test that components can modify values from beforeRedirect
*
* @return void
*/
function testBeforeRedirectModification() {
$this->markTestIncomplete('This test needs to be implemented');
/*
*$MockController = new MockController();
$MockController->components = array('MockTest');
$MockController->Component = new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', 'http://book.cakephp.org');
$MockController->expectAt(0, 'header', array('HTTP/1.1 301 Moved Permanently'));
$MockController->expectAt(1, 'header', array('Location: http://book.cakephp.org'));
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://cakephp.org', 301, false);
$MockController = new MockController();
$MockController->components = array('MockTest');
$MockController->Component = new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', false);
$MockController->expectNever('header');
$MockController->redirect('http://cakephp.org', 301, false);
$MockController = new MockController();
$MockController->components = array('MockTest', 'MockTestB');
$MockController->Component = new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', 'http://book.cakephp.org');
$MockController->MockTestB->setReturnValue('beforeRedirect', 'http://bakery.cakephp.org');
$MockController->expectAt(0, 'header', array('HTTP/1.1 301 Moved Permanently'));
$MockController->expectAt(1, 'header', array('Location: http://bakery.cakephp.org'));
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://cakephp.org', 301, false);
*/
}

/**
* test that components can pass modifying values from beforeRedirect
*
* @return void
*/
function testBeforeRedirectPass() {
$this->markTestIncomplete('This test needs to be implemented');
}

/**
* Test that SessionComponent doesn't get added if its already in the components array.
*
Expand Down

0 comments on commit 2ec6f75

Please sign in to comment.