Esempio n. 1
0
 public function test__construct()
 {
     $mockAdapter = $this->getMock('Dfp_Datafeed_Transfer_Adapter_Interface');
     $options = array('adapter' => $mockAdapter);
     $sut = new Dfp_Datafeed_Transfer($options);
     $this->assertEquals($mockAdapter, $sut->getAdapter());
     $c = new Zend_Config($options);
     $sut = new Dfp_Datafeed_Transfer($c);
     $this->assertEquals($mockAdapter, $sut->getAdapter());
     try {
         $sut = new Dfp_Datafeed_Transfer('invalid');
     } catch (Dfp_Datafeed_Transfer_Exception $e) {
         if ($e->getMessage() == 'Invalid parameter to constructor') {
             return;
         }
     }
     $this->fail('Exception not thrown');
 }