Skip to content

Commit

Permalink
Bringing more boolean tests up to date in postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 27, 2010
1 parent b3d8a61 commit eb49181
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,19 @@ function testDateAndTimeAsNull() {
* @return void
*/
function testBooleanNormalization() {
$this->assertTrue($this->Dbo2->boolean('t'));
$this->assertTrue($this->Dbo2->boolean('true'));
$this->assertTrue($this->Dbo2->boolean('TRUE'));
$this->assertTrue($this->Dbo2->boolean(true));
$this->assertTrue($this->Dbo2->boolean(1));
$this->assertTrue($this->Dbo2->boolean(" "));

$this->assertFalse($this->Dbo2->boolean('f'));
$this->assertFalse($this->Dbo2->boolean('false'));
$this->assertFalse($this->Dbo2->boolean('FALSE'));
$this->assertFalse($this->Dbo2->boolean(false));
$this->assertFalse($this->Dbo2->boolean(0));
$this->assertFalse($this->Dbo2->boolean(''));
$this->assertEquals(1, $this->Dbo2->boolean('t', false));
$this->assertEquals(1, $this->Dbo2->boolean('true', false));
$this->assertEquals(1, $this->Dbo2->boolean('TRUE', false));
$this->assertEquals(1, $this->Dbo2->boolean(true, false));
$this->assertEquals(1, $this->Dbo2->boolean(1, false));
$this->assertEquals(1, $this->Dbo2->boolean(" ", false));

$this->assertEquals(0, $this->Dbo2->boolean('f', false));
$this->assertEquals(0, $this->Dbo2->boolean('false', false));
$this->assertEquals(0, $this->Dbo2->boolean('FALSE', false));
$this->assertEquals(0, $this->Dbo2->boolean(false, false));
$this->assertEquals(0, $this->Dbo2->boolean(0, false));
$this->assertEquals(0, $this->Dbo2->boolean('', false));
}

/**
Expand Down

0 comments on commit eb49181

Please sign in to comment.