mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Adding two incomplete tests as they are not implemented. Pulling component tests out of the controller test case.
This commit is contained in:
parent
69559958a7
commit
2ec6f75996
1 changed files with 48 additions and 0 deletions
|
@ -569,6 +569,54 @@ class ComponentTest extends CakeTestCase {
|
|||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue