Skip to content

Commit

Permalink
little bug file while reading html file and little improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
daudmalik06 committed Jul 14, 2017
1 parent 995edd3 commit dd18d9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Chrome.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function getPdf($pdfPath=null)
{
$pdfPath.=".pdf";
}
$pdfName=$this->returnUniqueName(".pdf");
$pdfName=$this->returnUniqueName("pdf");
$printArray=[
'--print-to-pdf='=>$pdfPath?$pdfPath:$this->outPutDirectory.'/'.$pdfName,
];
Expand All @@ -154,7 +154,7 @@ public function getScreenShot($imagePath=null)
{
$imagePath.=".jpg";
}
$imageName=$this->returnUniqueName(".jpg");
$imageName=$this->returnUniqueName("jpg");
$printArray=[
'--screenshot='=>$imagePath?$imagePath:$this->outPutDirectory.'/'.$imageName,
];
Expand Down Expand Up @@ -273,7 +273,7 @@ public function getOutPutDirectory()
}

/**
* set the provided file as current url with file:/// protocol
* set the provided file as current url with file:// protocol
* @param string $file
* @throws \Exception if file not found
*/
Expand All @@ -283,7 +283,7 @@ public function useHtmlFile($file)
{
throw new \Exception("$file not found");
}
$this->setUrl("file:///".$file);
$this->setUrl("file://".$file);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/ChromeTestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testUseHtmlFile()
$htmlFile=__DIR__.'/index.html';
file_put_contents($htmlFile,"");
$chrome->useHtmlFile($htmlFile);
$this->assertEquals("file:///".$htmlFile,$chrome->getUrl());
$this->assertEquals("file://".$htmlFile,$chrome->getUrl());
@unlink($htmlFile);
}

Expand Down

0 comments on commit dd18d9b

Please sign in to comment.