Example #1
0
 /**
  * @param string $job
  * @param array  $config
  * @param Helper $helper
  */
 public function __construct($job, array $config, Helper $helper = null)
 {
     $this->job = $job;
     $this->config = $config + ['maxRuntime' => null, 'runAs' => null, 'environment' => null, 'runOnHost' => null, 'output' => null, 'dateFormat' => null, 'enabled' => null, 'haltDir' => null, 'debug' => null];
     $this->helper = $helper ?: new Helper();
     $this->tmpDir = $this->helper->getTempDir();
 }
Example #2
0
 /**
  * @covers ::getTempDir
  */
 public function testGetTempDir()
 {
     $valid = [sys_get_temp_dir(), getcwd()];
     foreach (['TMP', 'TEMP', 'TMPDIR'] as $key) {
         if (!empty($_SERVER[$key])) {
             $valid[] = $_SERVER[$key];
         }
     }
     $actual = $this->helper->getTempDir();
     $this->assertContains($actual, $valid);
 }