예제 #1
0
 /**
  * Testing Adding Employee Picture
  */
 public function testAddEmployeePictureException()
 {
     $empNumber = 102;
     $pic = new EmpPicture();
     $pic->setEmpNumber($empNumber);
     $pic->setFilename("pic_" . rand(0, 1000));
     $mockDao = $this->getMock('EmployeeDao');
     $mockDao->expects($this->once())->method('saveEmployeePicture')->with($pic)->will($this->throwException(new DaoException()));
     $this->employeeService->setEmployeeDao($mockDao);
     try {
         $result = $this->employeeService->saveEmployeePicture($pic);
         $this->fail("Exception expected");
     } catch (Exception $e) {
         $this->assertTrue($e instanceof PIMServiceException);
     }
 }
예제 #2
0
 /**
  * Testing Adding Employee Picture
  */
 public function testAddEmployeePictureException()
 {
     $empNumber = 102;
     $pic = new EmpPicture();
     $pic->setEmpNumber($empNumber);
     $pic->setFilename("pic_" . rand(0, 1000));
 }