Пример #1
0
 public function testAddErrors()
 {
     $sut = new Dfp_Datafeed_Transfer();
     $passed = false;
     try {
         $sut->addErrors(array('error', 'error2'));
     } catch (Dfp_Datafeed_Transfer_Exception $e) {
         $passed = true;
     }
     $this->assertTrue($passed, 'Failed to throw exception when adapter is missing');
     $mockAdapter = $this->getMock('Dfp_Datafeed_Transfer_Adapter_Interface');
     $mockAdapter->expects($this->once())->method('addErrors')->with($this->equalTo(array('error', 'error2')));
     $sut->setAdapter($mockAdapter);
     $sut->addErrors(array('error', 'error2'));
 }