예제 #1
0
 /**
  * Fetches the statuses of the circuit boards from the database.
  * @throws Exception If a query fails to execute.
  */
 public function fetchStatuses()
 {
     $database = new DatabaseWrapper();
     $database->connect(DB_NAME);
     $boards = $database->queryAllBoardInformation();
     foreach ($boards as $board) {
         $msisdn = $board->getMSISDN();
         $status = null;
         try {
             $status = $database->queryBoardStatus($msisdn);
         } catch (Exception $e) {
             /* failed to find its status */
         }
         $this->model->addBoard(new CircuitBoard($board, $status));
     }
 }
예제 #2
0
 function testQueryAllBoardInformation()
 {
     $result = $this->db->queryAllBoardInformation();
     $this->assertTrue(count($result) == 2);
 }