1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/tests/BooleanTestCase.php

44 lines
1.3 KiB
PHP

<?php
class Doctrine_BooleanTestCase extends Doctrine_UnitTestCase {
public function prepareData() { }
public function prepareTables() {
$this->tables = array("BooleanTest");
parent::prepareTables();
}
public function testSet() {
$test = new BooleanTest();
$test->is_working = true;
$this->assertEqual($test->is_working, true);
$test->save();
$test = new BooleanTest();
$test->is_working = true;
$test->save();
$test = new BooleanTest();
$this->is_working = false;
$this->assertEqual($test->is_working, false);
$test->save();
$test = new BooleanTest();
$this->is_working = false;
$test->save();
$test = new BooleanTest();
$this->is_working = false;
$test->save();
$query = new Doctrine_Query($this->connection);
$ret = $query->query('FROM BooleanTest WHERE BooleanTest.is_working = ?', array(false));
$this->assertEqual(count($ret), 3);
$query = new Doctrine_Query($this->connection);
$ret = $query->query('FROM BooleanTest WHERE BooleanTest.is_working = ?', array(true));
$this->assertEqual(count($ret), 2);
}
}
?>