Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
Fixing travis build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjosh committed Oct 30, 2019
1 parent 780e46c commit 82125bc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[![Build Status](https://api.travis-ci.org/MrJoshLab/laravel-phantomjs.svg?branch=develop)](https://travis-ci.org/iamalirezaj/laravel-phantomjs)
[![Build Status](https://api.travis-ci.org/MrJoshLab/laravel-phantomjs.svg?branch=develop)](https://travis-ci.org/MrJoshLab/laravel-phantomjs)
[![Latest Stable Version](https://poser.pugx.org/josh/laravel-phantomjs/v/stable)](https://packagist.org/packages/josh/laravel-phantomjs)
[![Total Downloads](https://poser.pugx.org/josh/laravel-phantomjs/downloads)](https://packagist.org/packages/josh/laravel-phantomjs)
[![Latest Unstable Version](https://poser.pugx.org/josh/laravel-phantomjs/v/unstable)](https://packagist.org/packages/josh/laravel-phantomjs)
[![License](https://poser.pugx.org/josh/laravel-phantomjs/license)](https://packagist.org/packages/josh/laravel-phantomjs)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/iamalirezaj)

# Laravel PhantomJs Client
Using phantomjs client in laravel
Expand Down
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"name": "josh/laravel-phantomjs",
"description": "Use phantom-js in laravel",
"keywords": ["phantomjs-php", "phantomjs","phantom-js", "laravel"],
"keywords": [
"phantomjs-php",
"phantomjs",
"phantom-js",
"laravel"
],
"license": "MIT",
"support": {
"issues": "https://github.com/iamalirezaj/laravel-phantomjs/issues",
"source": "https://github.com/iamalirezaj/laravel-phantomjs"
"issues": "https://github.com/MrJoshLab/laravel-phantomjs/issues",
"source": "https://github.com/MrJoshLab/laravel-phantomjs"
},
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/PhantomJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function isLazy()
* @param array $parameters
* @return Request
*/
public function request(string $url, string $method = RequestInterface::METHOD_GET, int $timeout = 5000, array $headers = [], array $parameters = []) : Request
public function request(string $url, string $method = "GET", int $timeout = 5000, array $headers = [], array $parameters = []) : Request
{
$request = new Request($url, $method, $timeout);

Expand Down
10 changes: 6 additions & 4 deletions tests/PhantomJsRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Tests;

use Illuminate\Support\Str;

class PhantomJsRequestTest extends TestCase
{
/**
Expand All @@ -13,11 +15,11 @@ class PhantomJsRequestTest extends TestCase
*/
public function testSimpleRequest()
{
$request = $this->phantomjs->get('http://phantomjs.org/');
$request = $this->phantomjs->get('https://www.google.com/');

$response = $this->phantomjs->send($request);

$this->assertEquals($response->getUrl(),'http://phantomjs.org/');
$this->assertEquals($response->getUrl(),'https://www.google.com/');
$this->assertEquals($response->getStatus(),200);
}

Expand All @@ -32,7 +34,7 @@ public function testSimpleRequest()
public function testCreatePdf()
{
$request = $this->phantomjs->createPdf('http://phantomjs.org/');
$request->setOutputFile($filename = str_random(30) . '.pdf');
$request->setOutputFile($filename = Str::random(30) . '.pdf');
$request->setFormat('A4');
$request->setOrientation('landscape');
$request->setMargin('1cm');
Expand All @@ -54,7 +56,7 @@ public function testCreatePdf()
public function testCreateImage()
{
$request = $this->phantomjs->createImage('http://phantomjs.org/');
$request->setOutputFile($filename = str_random(30) . '.png');
$request->setOutputFile($filename = Str::random(30) . '.png');
$request->setViewportSize(800, 600);
$request->setCaptureDimensions(800, 600, 0, 0);

Expand Down

0 comments on commit 82125bc

Please sign in to comment.