Ejemplo n.º 1
0
 public function testSetters()
 {
     $testEntity = new TestEntity();
     $testEntity->setId(self::$testData['id']);
     $testEntity->setName(self::$testData['name']);
     $testEntity->setTestForeignEntity(self::$testData['testForeignEntity']);
     $testEntity->setCollection(self::$testData['collection']);
     $testEntity->setInt(self::$testData['int']);
     $testEntity->setBool(self::$testData['bool']);
     $this->testGetters($testEntity);
 }
Ejemplo n.º 2
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');
 }
Ejemplo n.º 3
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'));
 }