Esempio n. 1
0
 public function testgetPairs()
 {
     $data = array();
     $database = $this->getMockBuilder('\\Box_Database')->getMock();
     $database->expects($this->atLeastOnce())->method('getAssoc')->will($this->returnValue(array()));
     $di = new \Box_Di();
     $di['db'] = $database;
     $di['array_get'] = $di->protect(function (array $array, $key, $default = null) use($di) {
         return isset($array[$key]) ? $array[$key] : $default;
     });
     $clientService = new \Box\Mod\Client\Service();
     $clientService->setDi($di);
     $result = $clientService->getPairs($data);
     $this->assertInternalType('array', $result);
 }