Ejemplo n.º 1
0
 public function testInitData()
 {
     $e = new SearchTest();
     $e->title = 'Once there was an ORM framework';
     $e->content = 'There are many ORM frameworks, but nevertheless we decided to create one.';
     $e->save();
     $e = new SearchTest();
     $e->title = 'Doctrine development continues';
     $e->content = 'The development has been going well so far.';
     $e->save();
 }
Ejemplo n.º 2
0
    public function testUpdateIndexInsertsNullValuesForBatchUpdatedEntries()
    {
        $e = new SearchTest();
        $tpl = $e->getTable()->getTemplate('Doctrine_Template_Searchable');
        $tpl->getPlugin()->setOption('batchUpdates', true);

        $e->title = 'Some searchable title';
        $e->content = 'Some searchable content';

        $e->save();
        
        $coll = Doctrine_Query::create()
                ->from('SearchTestIndex s')
                ->orderby('s.id DESC')
                ->limit(1)
                ->setHydrationMode(Doctrine::HYDRATE_ARRAY)
                ->fetchOne();

        $this->assertEqual($coll['id'], 2);
        $this->assertEqual($coll['keyword'], null);
        $this->assertEqual($coll['field'], null);
        $this->assertEqual($coll['position'], null);
    }