/** * Test dump(). * * @return void */ public function testDump() { $beans = R::dispense('bean', 2); $beans[0]->name = 'hello'; $beans[1]->name = 'world'; $array = R::dump($beans); asrt(is_array($array), TRUE); foreach ($array as $item) { asrt(is_string($item), TRUE); } $beans[1]->name = 'world, and a very long string that should be shortened'; $array = R::dump($beans); asrt(is_array($array), TRUE); asrt(strpos($array[1], '...'), 35); //just to get 100% test cov, we dont need to test this dmp($beans); pass(); //test wrong input asrt(is_array(R::dump(NULL)), TRUE); asrt(count(R::dump(NULL)), 0); asrt(is_array(R::dump('')), TRUE); asrt(count(R::dump('')), 0); asrt(is_array(R::dump(1)), TRUE); asrt(count(R::dump(1)), 0); asrt(is_array(R::dump(TRUE)), TRUE); asrt(count(R::dump(FALSE)), 0); }
function dmp($list) { print_r(\RedBeanPHP\Facade::dump($list)); }