Ejemplo n.º 1
0
$group->one = $one;
$group->two = $two;
$group->service = $service;
$t = new lime_test(11, new lime_output_color());
$t->ok($group->getIndex('child1') === $one, '->getIndex() returns the index');
try {
    $msg = '->getIndex() fails if index does not exist';
    $group->getIndex('foobar');
    $t->fail($msg);
} catch (Exception $e) {
    $t->pass($msg);
}
$t->ok($one->getLogger() === $logger, '->setup() configures the logger of the child');
$t->ok($one->getServiceRegistry() === $group->getServiceRegistry(), '->search() passes on the service registry');
$t->ok($two->getServiceRegistry() !== $group->getServiceRegistry(), '->setup() does not override a service registry');
$group->insert('foo');
$engine = $one->getEngine();
$t->is($engine->count(), 1, '->insert() adds to the child indices');
$group->remove('foo');
$t->is($engine->count(), 0, '->remove() removes from the child indices');
$group->populate();
$t->is($engine->count(), 3, '->populate() populates the child indices');
$group->optimize();
$t->is($engine->optimized, 1, '->optimize() optimizes the child indices');
$description = $group->describe();
$t->is(count($description), 2, '->describe() returns information about the child indices');
try {
    $msg = '->find() fails always';
    $group->find(new xfCriteria());
    $t->fail($msg);
} catch (Exception $e) {