Crontab\Crontab::render PHP Method

render() public method

Render the crontab and associated jobs
public render ( ) : string
return string
    public function render()
    {
        return implode(PHP_EOL, array_merge($this->getVariables(), $this->getJobs()));
    }

Usage Example

 public function testWriteToFileIsSuccessfulWhenFileIsWritable()
 {
     $this->crontabFileHandler->parseFromFile($this->crontab, $this->fixturesDir . '/crontab');
     $file = tempnam(sys_get_temp_dir(), 'cron');
     $this->crontabFileHandler->writeToFile($this->crontab, $file);
     $this->assertSame($this->crontab->render() . PHP_EOL, file_get_contents($file));
     unlink($file);
 }
All Usage Examples Of Crontab\Crontab::render