$t->is($i['Engine'], 'sfLucene 0.5-DEV', '->describe() has the correct engine version'); $t->is($i['Implementation'], 'Zend_Search_Lucene 1.5', '->describe() has the correct Zend_Search_Lucene version'); $t->is($i['Location'], LOCATION, '->describe() has the correct location'); $t->is($i['Total Documents'], 4, '->describe() has the correct total number of documents'); $t->is($i['Total Segments'], 1, '->describe() has the correct total number of segments'); $t->is($i['Total Size'], '0.008 MB', '->describe() has the correct total total size'); $t->is($i['Analyzer'], 'Text', '->describe() has the correct analyzer'); class FooAnalyzer extends Zend_Search_Lucene_Analysis_Analyzer_Common_Text { } $engine->setAnalyzer(new FooAnalyzer()); $i = $engine->describe(); $t->is($i['Analyzer'], 'FooAnalyzer', '->describe() does not crop an external analyzer class name'); $t->diag('->delete()'); $engine->commit(); $engine->delete('guid'); $engine->commit(); $t->is($engine->count(), 3, '->delete() removes a document'); $t->diag('->erase()'); $engine->add(new xfDocument('doc')); $engine->commit(); $engine->erase(); $t->is($engine->count(), 0, '->erase() empties the index if it is open'); $t->isa_ok($engine->getIndex(), 'Zend_Search_Lucene_Proxy', '->erase() leaves the index open if it is open'); $engine->add(new xfDocument('doc')); $engine->close(); $engine->erase(); try { $msg = '->erase() leaves the index close if it is closed'; $engine->getIndex(); $t->fail($msg);