/** * Tests the facade-only dispenseAll method. * * @return void */ public function testDispenseAll() { list($book, $page) = RedBean_Facade::dispenseAll('book,page'); asrt($book instanceof RedBean_OODBBean, true); asrt($page instanceof RedBean_OODBBean, true); asrt($book->getMeta('type'), 'book'); asrt($page->getMeta('type'), 'page'); list($book, $page, $texts, $mark) = R::dispenseAll('book,page,text*2,mark'); asrt($book instanceof RedBean_OODBBean, true); asrt($page instanceof RedBean_OODBBean, true); asrt(is_array($texts), true); asrt($mark instanceof RedBean_OODBBean, true); asrt($book->getMeta('type'), 'book'); asrt($page->getMeta('type'), 'page'); asrt($mark->getMeta('type'), 'mark'); asrt($texts[0]->getMeta('type'), 'text'); asrt($texts[1]->getMeta('type'), 'text'); list($eggs, $milk, $butter) = R::dispenseAll('eggs*3,milk*1,butter*9'); asrt(count($eggs), 3); asrt($milk instanceof RedBean_OODBBean, true); asrt(count($butter), 9); list($beer) = R::dispenseAll('beer*0'); asrt(is_array($beer), true); asrt(count($beer), 0); }