Updating component tests

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6271 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-12-29 16:35:38 +00:00
parent 658b98e361
commit d38bb91d1c
2 changed files with 23 additions and 5 deletions

View file

@ -41,8 +41,9 @@ class RequestHandlerComponentTest extends CakeTestCase {
}
function testRenderAs() {
$this->assertFalse(in_array('Xml', $this->Controller->helpers));
$this->RequestHandler->renderAs($this->Controller, 'xml');
$this->assertEqual($this->Controller->helpers, array('Html', 'Xml'));
$this->assertTrue(in_array('Xml', $this->Controller->helpers));
}
function tearDown() {

View file

@ -26,7 +26,9 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
uses('controller' . DS . 'components' . DS .'session');
uses('controller' . DS . 'controller', 'controller' . DS . 'components' . DS .'session');
class SessionTestController extends Controller {}
/**
* Short description for class.
*
@ -35,8 +37,23 @@ uses('controller' . DS . 'components' . DS .'session');
*/
class SessionComponentTest extends CakeTestCase {
function skip() {
$this->skipif (true, 'SessionComponentTest not implemented');
function setUp() {
$this->Session = new SessionComponent();
}
function testSessionAutoStart() {
$this->Session->startup(new SessionTestController());
$this->assertTrue(isset($_SESSION) && empty($_SESSION));
}
function testSessionWriting() {
$this->assertTrue($this->Session->write('Test.key.path', 'some value'));
$this->assertEqual($this->Session->read('Test.key.path'), 'some value');
}
function tearDown() {
unset($this->Session);
}
}
?>
?>