@@ -29,7 +29,7 @@ public function testFormatWithOneRowAndValueIsNotZero()
$books = $formatter -> format($stmt );
$this -> assertInstanceOf(' PropelCollection' , $books );
$this -> assertCount(4 , $books );
- $this -> assertSame (' 1' , $books [0 ]);
+ $this -> assertEquals (' 1' , $books [0 ]);
}
public function testFormatWithOneRowAndValueEqualsZero ()
@@ -43,30 +43,57 @@ public function testFormatWithOneRowAndValueEqualsZero()
$books = $formatter -> format($stmt );
$this -> assertInstanceOf(' PropelCollection' , $books );
$this -> assertCount(4 , $books );
- $this -> assertSame (' 0' , $books [0 ]);
+ $this -> assertEquals (' 0' , $books [0 ]);
}
public function testFormatOneWithOneRowAndValueIsNotZero ()
{
$con = Propel :: getConnection(BookPeer :: DATABASE_NAME );
- $stmt = $con -> query(' SELECT 1 FROM book LIMIT 0 , 1 ' );
+ $stmt = $con -> query(' SELECT 1 FROM book LIMIT 1 OFFSET 0 ' );
$formatter = new PropelSimpleArrayFormatter ();
$formatter -> init(new ModelCriteria (' bookstore' , ' Book' ));
$book = $formatter -> formatOne($stmt );
- $this -> assertSame (' 1' , $book );
+ $this -> assertEquals (' 1' , $book );
}
public function testFormatOneWithOneRowAndValueEqualsZero ()
{
$con = Propel :: getConnection(BookPeer :: DATABASE_NAME );
- $stmt = $con -> query(' SELECT 0 FROM book LIMIT 0 , 1 ' );
+ $stmt = $con -> query(' SELECT 0 FROM book LIMIT 1 OFFSET 0 ' );
$formatter = new PropelSimpleArrayFormatter ();
$formatter -> init(new ModelCriteria (' bookstore' , ' Book' ));
$book = $formatter -> formatOne($stmt );
- $this -> assertSame(' 0' , $book );
+ $this -> assertEquals(' 0' , $book );
+ }
+
+ public function testFormatOneWithOneRowAndValueBooleanEqualsFalse ()
+ {
+ $con = Propel :: getConnection(BookPeer :: DATABASE_NAME );
+ $stmt = $con -> query(' SELECT false FROM book LIMIT 1 OFFSET 0 ' );
+
+ $formatter = new PropelSimpleArrayFormatter ();
+ $formatter -> init(new ModelCriteria (' bookstore' , ' Book' ));
+
+ $book = $formatter -> formatOne($stmt );
+ $this -> assertNotNull($book );
+ $this -> assertSame(false , (bool )$book );
+ }
+
+ public function testFormatWithOneRowAndValueBooleanEqualsFalse ()
+ {
+ $con = Propel :: getConnection(BookPeer :: DATABASE_NAME );
+ $stmt = $con -> query(' SELECT false FROM book' );
+
+ $formatter = new PropelSimpleArrayFormatter ();
+ $formatter -> init(new ModelCriteria (' bookstore' , ' Book' ));
+
+ $books = $formatter -> format($stmt );
+ $this -> assertInstanceOf(' PropelCollection' , $books );
+ $this -> assertCount(4 , $books );
+ $this -> assertSame(false , (bool )$books [0 ]);
}
}
0 comments on commit
19ac478