Example #1
0
 public function test_getServiceOrderNotFound()
 {
     $data = array('order_id' => 1);
     $clientOrderModel = null;
     $dbMock = $this->getMockBuilder('\\Box_Database')->getMock();
     $dbMock->expects($this->atLeastOnce())->method('findOne')->will($this->returnValue($clientOrderModel));
     $di = new \Box_Di();
     $di['db'] = $dbMock;
     $this->api->setDi($di);
     $clientModel = new \Model_Client();
     $clientModel->loadBean(new \RedBeanPHP\OODBBean());
     $clientModel->id = 1;
     $this->api->setIdentity($clientModel);
     $this->setExpectedException('\\Box_Exception', 'Order not found');
     $this->api->_getService($data);
 }