/** * @covers ::setBaseUrl * @covers ::getBaseUrl * @covers ::setBinaryPath * @covers ::getBinaryPath * @covers ::setStoragePath * @covers ::getStoragePath * @covers ::setTimeout * @covers ::getTimeout * @covers ::ignoreSSLErrors * @covers ::addCommandLineOption * @covers ::getCommandLineOptions * @covers ::setConvertScript * @covers ::getConvertScript */ public function testConstruct() { $timeout = 20; $storagePath = 'some-dir'; $script = 'otherScript.js'; $baseUrl = 'https://example.com/test'; $phantomjs = '/var/bin/phantomjs'; $orientation = 'landscape'; $generator = new PdfGenerator(); $generator->setStoragePath($storagePath)->setTimeout($timeout)->setBaseUrl($baseUrl)->setConvertScript($script)->setOrientation($orientation)->ignoreSSLErrors()->setBinaryPath($phantomjs)->addCommandLineOption('--other-option=Test'); $this->assertEquals($storagePath, $generator->getStoragePath(), 'Should save storage path'); $this->assertEquals($timeout, $generator->getTimeout(), 'Should save timeout'); $this->assertEquals($baseUrl, $generator->getBaseUrl(), 'Should save base url'); $this->assertEquals($script, $generator->getConvertScript(), 'Should save converter script'); $this->assertEquals($phantomjs, $generator->getBinaryPath(), 'Should save binary path'); $this->assertEquals(['--ignore-ssl-errors=true', '--other-option=Test'], $generator->getCommandLineOptions(), 'Should combine data from ignoreSSLErrors and addCommandLineOption'); $this->assertEquals($orientation, $generator->getOrientation(), 'Should save orientation'); }