/** * Для синхронизации надо выбирать только активные валюты */ public function testFindActiveForSync() { // Деактивировать все валюты кроме первой Doctrine::getTable('Currency')->createQuery()->update()->set('is_active', 0)->where('id > ?', 1)->execute(); $q = new mySyncOutCurrencyQuery(new myDatetimeRange(new DateTime('-1year'), new DateTime()), null); $found = $q->getQuery()->execute(); $this->assertEquals(1, $found->count()); $this->assertEquals(1, $found->getFirst()->getId()); }
/** * Выбрать список объектов, у которых нет пользователя */ public function testFindModifiedWithoutUser() { $table = Doctrine::getTable('Currency'); $c1 = $table->find(1); $c1->setDateTimeObject('updated_at', $this->_makeDate(1000)); $c1->save(); $q = new mySyncOutCurrencyQuery($this->_makeDateRange(100, 1100), null); $found = $q->getQuery()->execute(); $this->assertEquals(1, $found->count()); $this->assertEquals($c1->getId(), $found->getFirst()->getId()); }