public function testFindBy() { $this->assertEquals(0, count($this->service->findBy(array()))); $item = new NewsItem('item:1'); $this->service->save($item); $item = new PackageItem('item:2'); $this->service->save($item); $this->odm->clear(); $items = $this->service->findBy(array(), array('id' => 'asc')); $this->assertEquals(2, count($items)); $this->assertInstanceOf('Newscoop\\News\\NewsItem', $items->getNext()); $this->assertInstanceOf('Newscoop\\News\\PackageItem', $items->getNext()); }