/** * Testing that the index method is generating tags as expected. * * @since 1.2.3 */ public function testIndex() { $this->article->save(); $tag = new Tag(); $tag->dropTable(); $tag->rebuildTable(); $provider = SearchProviderFactory::getInstance('Alpha\\Util\\Search\\SearchProviderTags'); $provider->index($this->article); $tags = $this->article->getPropObject('tags')->getRelatedObjects(); $found = false; foreach ($tags as $tag) { if ($tag->get('content') == 'unittestarticle') { $found = true; break; } } $this->assertTrue($found, 'Testing that the index method is generating tags as expected'); }
/** * Tear down tests. * * @since 1.0 */ protected function tearDown() { $article = new Article(); $article->dropTable(); $tag = new Tag(); $tag->dropTable(); $denum = new DEnum(); $denum->dropTable(); $item = new DEnumItem(); $item->dropTable(); unset($this->article); }
/** * (non-PHPdoc). * * @see alpha/lib/PEAR/PHPUnit-3.2.9/PHPUnit/Framework/PHPUnit_Framework_TestCase::tearDown() * @since 1.0 */ protected function tearDown() { $config = ConfigProvider::getInstance(); $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray'); $this->controller->abort(); $this->article->dropTable(); unset($this->article); unset($this->controller); $this->person->dropTable(); unset($this->person); $this->group->dropTable(); $this->group->dropTable('Person2Rights'); unset($this->group); $article = new Article(); $article->dropTable(); $tag = new Tag(); $tag->dropTable(); $denum = new DEnum(); $denum->dropTable(); $item = new DEnumItem(); $item->dropTable(); }