3 namespace Doctrine\Tests\ORM\Functional\Ticket;
5 use Doctrine\Common\Collections\ArrayCollection;
6 use Doctrine\Tests\Models\Generic\BooleanModel;
8 require_once __DIR__ . '/../../../TestInit.php';
10 class DDC949Test extends \Doctrine\Tests\OrmFunctionalTestCase
12 public function setUp()
14 $this->useModelSet('generic');
21 public function testBooleanThroughRepository()
23 $true = new BooleanModel();
24 $true->booleanField = true;
26 $false = new BooleanModel();
27 $false->booleanField = false;
29 $this->_em->persist($true);
30 $this->_em->persist($false);
34 $true = $this->_em->getRepository('Doctrine\Tests\Models\Generic\BooleanModel')->findOneBy(array('booleanField' => true));
35 $false = $this->_em->getRepository('Doctrine\Tests\Models\Generic\BooleanModel')->findOneBy(array('booleanField' => false));
37 $this->assertInstanceOf('Doctrine\Tests\Models\Generic\BooleanModel', $true, "True model not found");
38 $this->assertTrue($true->booleanField, "True Boolean Model should be true.");
40 $this->assertInstanceOf('Doctrine\Tests\Models\Generic\BooleanModel', $false, "False model not found");
41 $this->assertFalse($false->booleanField, "False Boolean Model should be false.");