Adding tests for writing falsey values.

This commit is contained in:
mark_story 2010-09-12 14:08:17 -04:00
parent 6519de3a2e
commit 404e49b37d

View file

@ -1303,6 +1303,27 @@ class CakeRequestTestCase extends CakeTestCase {
$this->assertEquals($request->data['Comment']['1']['author'], 'Mark');
}
/**
* test writing falsey values.
*
* @return void
*/
function testDataWritingFalsey() {
$request = new CakeRequest('posts/index');
$request->data('Post.null', null);
$this->assertNull($request->data['Post']['null']);
$request->data('Post.false', false);
$this->assertFalse($request->data['Post']['false']);
$request->data('Post.zero', 0);
$this->assertSame(0, $request->data['Post']['zero']);
$request->data('Post.empty', '');
$this->assertSame('', $request->data['Post']['empty']);
}
/**
* backupEnvironment method
*