public function xtestSetup() { $db = $this->getDb(); $table = $this->getTable(__FUNCTION__); $_id_list = $this->addRows($db, $table, 5); ///$where_criteria = new MingoCriteria(); ///$where_criteria->ninFoo(1,2); ///$where_criteria->is_q('foo:(-1 -2)'); $list = $db->getQuery('foo NOT foo:(1 2)', array('table' => $table)); out::e($list); $this->assertEquals(3, count($list)); $this->assureSubset($list, $_id_list); return; $db = $this->getDb(); $table = $this->getTable(__FUNCTION__); ///$table = new MingoTable(__FUNCTION__); $_id_list = array(); for ($i = 0; $i < 5; $i++) { $map = array('foo' => $i); $map = $db->set($table, $map); $_id_list[] = (string) $map['_id']; } //for out::e($_id_list); $c = new MingoCriteria(); $c->in_id($_id_list); $list = $db->get($table, $c); out::e($list); $count = $db->getCount($table, $c); out::e($count); ///$db->getQuery('_id:(1z4ddb7b390b5b1759137267 OR 6z4ddb7b39119fc745281592)',array('table' => $table)); }
/** * @since 11-7-11 */ public function testCreate() { $arr = new Arr('one', 'two', 'three'); $narr = $arr->getArrayCopy(); $this->assertEquals(array('one', 'two', 'three'), $narr); $arr = new Arr(array('one', 'two', 'three')); $narr = $arr->getArrayCopy(); $this->assertEquals(array('one', 'two', 'three'), $narr); $arr[] = 'four'; \out::e($arr->getArrayCopy()); }
/** * get the response of a $resource * * this will block (ie, wait for a response * * @param resource $resource the process to read from * @return array the response */ protected function getResponse($resource) { $ret_map = array(); $ret_str = ''; $ret_str = stream_get_contents($resource); ///out::e($ret_str); $ret_map = unserialize($ret_str); if ($ret_map === false) { out::e($ret_str); } //if return $ret_map; }
public function xtestPathStuff() { ///$path = new Path('E:\Projects\sandbox\montage\_active\test\fixtures\Path'); $path = new Path('E:\\Projects\\sandbox\\montage\\_active\\test\\fixtures\\Path\\che.txt'); foreach ($path as $p) { \out::e($p); } //foreach return; \out::b(); \out::p('iterate'); foreach ($path->createIterator() as $p) { \out::e($p->getFilename()); \out::e($p->getBasename()); } //foreach \out::p(); }