예제 #1
0
 public function testgetAdminGroupPair()
 {
     $rows = array(array('id' => '1', 'name' => 'First Jogh'), array('id' => '2', 'name' => 'Another Smith'));
     $expected = array(1 => 'First Jogh', 2 => 'Another Smith');
     $dbMock = $this->getMockBuilder('\\Box_Database')->getMock();
     $dbMock->expects($this->atLeastOnce())->method('getAll')->will($this->returnValue($rows));
     $di = new \Box_Di();
     $di['db'] = $dbMock;
     $service = new \Box\Mod\Staff\Service();
     $service->setDi($di);
     $result = $service->getAdminGroupPair();
     $this->assertEquals($expected, $result);
     $this->assertInternalType('array', $result);
 }