Fix value check and formatting.

This commit is contained in:
Yevgeny Tomenko 2016-01-28 23:36:07 +03:00
parent e83a532af0
commit 70c4e40532
2 changed files with 2 additions and 2 deletions

View file

@ -934,7 +934,7 @@ class Postgres extends DboSource {
*/ */
public function value($data, $column = null, $null = true) { public function value($data, $column = null, $null = true) {
$value = parent::value($data, $column, $null); $value = parent::value($data, $column, $null);
if ($column == 'uuid' && is_scalar($data)) { if ($column === 'uuid' && is_scalar($data)) {
if ($data === '') { if ($data === '') {
return 'NULL'; return 'NULL';
} }

View file

@ -501,7 +501,7 @@ class SecurityComponentTest extends CakeTestCase {
$this->Controller->request->data = array( $this->Controller->request->data = array(
'Model' => array('username' => 'nate', 'password' => 'foo', 'valid' => '0'), 'Model' => array('username' => 'nate', 'password' => 'foo', 'valid' => '0'),
'_Token' => compact('fields', 'unlocked') '_Token' => compact('fields', 'unlocked')
); );
$this->assertFalse($this->Controller->failed, 'Should not be failed yet'); $this->assertFalse($this->Controller->failed, 'Should not be failed yet');
$this->Controller->Security->startup($this->Controller); $this->Controller->Security->startup($this->Controller);
$this->assertTrue($this->Controller->failed, 'Should fail because of validatePost.'); $this->assertTrue($this->Controller->failed, 'Should fail because of validatePost.');