1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/tests/BooleanTestCase.php

44 lines
1.3 KiB
PHP
Raw Normal View History

<?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);
}
}
?>