Skip to content

Commit

Permalink
Use recent PHP version matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrodzicki committed Oct 22, 2017
1 parent 7c84271 commit cfdd100
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- '5.6'
- '7.0'
- '7.1'

before_script:
- wget http://getcomposer.org/composer.phar
- php composer.phar install
- composer install

script: phpunit --coverage-text
script: phpunit
14 changes: 8 additions & 6 deletions tests/PageSpeed/Tests/Insights/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

namespace PageSpeed\Tests\Insights;

class ServiceTest extends \PageSpeed\Tests\PageSpeedTestCase
use PageSpeed\Insights\Service;
use PageSpeed\Tests\PageSpeedTestCase;

class ServiceTest extends PageSpeedTestCase
{
/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testInvalidUrl()
{
$pageSpeed = new \PageSpeed\Insights\Service();
$pageSpeed = new Service();
$pageSpeed->getResults('localhost');
}

public function testResults()
{
$pageSpeed = new \PageSpeed\Insights\Service();
$pageSpeed = new Service();
$url = 'https://github.com/sgrodzicki/pagespeed';
$results = $pageSpeed->getResults($url);

Expand All @@ -26,8 +29,7 @@ public function testResults()

$this->assertEquals($url, $results['id']);
$this->assertEquals(200, $results['responseCode']);
$this->assertStringStartsWith('sgrodzicki/pagespeed', $results['title']);
$this->assertStringEndsWith('GitHub', $results['title']);
$this->assertEquals('GitHub - sgrodzicki/pagespeed: A PHP library to interact with the PageSpeed Insights API', $results['title']);
$this->assertTrue(is_array($results['pageStats']));
$this->assertTrue(is_array($results['formattedResults']));
$this->assertTrue(is_array($results['version']));
Expand Down
4 changes: 3 additions & 1 deletion tests/PageSpeed/Tests/PageSpeedTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace PageSpeed\Tests;

abstract class PageSpeedTestCase extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

abstract class PageSpeedTestCase extends TestCase
{

}

0 comments on commit cfdd100

Please sign in to comment.