Example #1
0
 public function test__construct()
 {
     $mockFormat = $this->getMock('Dfp_Datafeed_File_Reader_Format_Interface');
     $options = array('format' => $mockFormat);
     $sut = new Dfp_Datafeed_File_Reader($options);
     $this->assertEquals($mockFormat, $sut->getFormat());
     $c = new Zend_Config($options);
     $sut = new Dfp_Datafeed_File_Reader($c);
     $this->assertEquals($mockFormat, $sut->getFormat());
     try {
         $sut = new Dfp_Datafeed_File_Reader('invalid');
     } catch (Dfp_Datafeed_File_Reader_Exception $e) {
         if ($e->getMessage() == 'Invalid parameter to constructor') {
             return;
         }
     }
     $this->fail('Exception not thrown');
 }