Example #1
0
 /**
  * @test
  */
 public function downloadExistingPage()
 {
     $this->wgetCommand->setOutputFile(Files::concatenatePaths(array($this->workingDirectory, 'wget.log')))->setDirectoryPrefix($this->workingDirectory)->setNoVerbose(true)->setServerResponse(true)->setUrl('http://localhost/')->execute();
     $log = $this->wgetLogParser->parseLog($this->wgetCommand);
     $this->assertFalse($log->hasErrors());
     $this->assertFileExists(Files::concatenatePaths(array($this->workingDirectory, 'index.html')));
 }
 /**
  * @test
  */
 public function buildLogFileEntryArrayTest()
 {
     $wgetLog = $this->wgetLogParser->_call('buildLogFileEntryArray', $this->testWgetLogEntry2);
     /** @var $wgetLog WgetLog */
     $expected = array('date' => date_create_from_format('Y-m-d H:i:s', '2015-01-26 17:50:43'), 'url' => 'https://test.de/typo3temp/stylesheet_c89de9523c.1422025907.css', 'status' => 200, 'length' => 360);
     $this->assertEquals(1, $wgetLog->count());
     $this->assertEquals($expected, $wgetLog->getItemByIndex(0)->toArray());
 }