예제 #1
0
 public function testGetSetData()
 {
     $config = new ExportSettings();
     $this->assertNull($config->getData());
     $config->setData(['foo' => 6, 'bar' => '321']);
     $this->assertSame(['foo' => 6, 'bar' => '321'], $config->getData());
 }
예제 #2
0
 /**
  * @throws Exception\EmptyHeadersException
  * @throws Exception\InvalidArgumentTypeException
  * @throws Exception\OutputPathNotWritableException
  */
 public function validateOutput()
 {
     $headers = $this->config->getHeaders();
     if (empty($headers)) {
         throw new Exception\EmptyHeadersException();
     }
     if (!is_writable($this->config->getOutputDir())) {
         throw new Exception\OutputPathNotWritableException();
     }
     if (!is_string($this->config->getFilename())) {
         throw new Exception\InvalidArgumentTypeException();
     }
     $data = $this->config->getData();
     if (empty($data)) {
         throw new Exception\DataNotFoundException();
     }
 }