Esempio n. 1
0
 public function setUp()
 {
     parent::setUp();
     for ($i = 0; $i < 100; ++$i) {
         self::$entityManager->persist(TestEntity::createRandomTestEntity($i, $i % 2));
     }
     self::$entityManager->flush();
     $entities = self::$entityManager->createQuery('SELECT e FROM Rexmac\\Zyndax\\Doctrine\\Entity\\TestEntity e')->execute();
     $this->assertEquals(100, count($entities));
     $this->adapter = new DoctrineAdapter('Rexmac\\Zyndax\\Doctrine\\Entity\\TestEntity');
 }
Esempio n. 2
0
 public function testGetTotalWhere()
 {
     for ($i = 0; $i < 10; ++$i) {
         $e = TestEntity::createRandomTestEntity();
         $e->setBool($i % 2);
         self::$entityManager->persist($e);
     }
     self::$entityManager->flush();
     $this->assertEquals(5, TestEntityService::getTotal('e.bool = 1'));
 }