コード例 #1
0
 /**
  * @expectedException \Exception
  */
 public function test_qualification_rollback()
 {
     /** === Test Data === */
     $DATE_PERFORMED = 'performed';
     $DATE_APPLIED = 'applied';
     $GV_MAX_LEVELS = 3;
     /** === Setup Mocks === */
     $this->mLogger->shouldReceive('info');
     // $respGetPeriod = $this->_callBasePeriod->getForDependentCalc($reqGetPeriod);
     $mRespGetPeriod = new \Praxigento\BonusBase\Service\Period\Response\GetForDependentCalc();
     $this->mCallBasePeriod->shouldReceive('getForDependentCalc')->once()->andReturn($mRespGetPeriod);
     // if($respGetPeriod->isSucceed()) {
     $mRespGetPeriod->markSucceed();
     // $this->_getConn()->beginTransaction();
     $this->mConn->shouldReceive('beginTransaction')->once();
     // $tree = $this->_repoMod->getCompressedTree($calcIdBase);
     $this->mRepoMod->shouldReceive('getCompressedTree')->andThrow(new \Exception());
     // $conn->rollback();
     $this->mConn->shouldReceive('rollback')->once();
     /** === Call and asserts  === */
     $req = new Request\Qualification();
     $req->setDatePerformed($DATE_PERFORMED);
     $req->setDateApplied($DATE_APPLIED);
     $req->setGvMaxLevels($GV_MAX_LEVELS);
     $resp = $this->call->qualification($req);
     $this->assertFalse($resp->isSucceed());
 }