Skip to content

Commit 752f9ef

Browse files
committed
Test enhancement
1 parent 4e7dc81 commit 752f9ef

7 files changed

+30
-10
lines changed

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
language: php
22
before_script:
33
- composer install --dev --no-interaction
4-
- cd test/unit
54
script:
6-
- ../../vendor/bin/phpunit . --bootstrap bootstrap.php --filter test* --coverage-clover=coverage.xml
5+
- vendor/bin/phpunit --coverage-clover=coverage.xml
76
after_success:
87
- bash <(curl -s https://codecov.io/bash)
98
php:
109
- 5.6
1110
- 7.0
11+
- 7.1
12+
- 7.2
1213
env:
1314
global:
1415
- secure: eUN0huKA436uIkISu6V3yW01/gZHC6slBvlnprMPEhzclU2szH6qhWEXWS5CcOG6EEDBReqLZdNAwu+FC69KGFO9+6oW2GQQLSsfEViqFi/Ig2N0r4EBO4jLRebgq0GOfetPwQvJH27d8BCiloPy8rXBb5pskxSNw4B4bRyXHz4=

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"php": ">=5.6"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "~4.4",
23+
"phpunit/phpunit": "^5.7 || ^6.5",
2424
"squizlabs/php_codesniffer": "~2.0"
2525
},
2626
"autoload": {

test/phpunit.xml.dist

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit colors="true" bootstrap="../vendor/autoload.php">
3+
<testsuites>
4+
<testsuite name="All">
5+
<directory>.</directory>
6+
</testsuite>
7+
</testsuites>
8+
<filter>
9+
<whitelist processUncoveredFilesFromWhitelist="true">
10+
<directory suffix=".php">../lib</directory>
11+
</whitelist>
12+
</filter>
13+
</phpunit>

test/unit/ClientTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
namespace SendGrid\Test;
44

55
use SendGrid\Client;
6+
use PHPUnit\Framework\TestCase;
67

7-
class ClientTest extends \PHPUnit_Framework_TestCase
8+
class ClientTest extends TestCase
89
{
910
/** @var MockClient */
1011
private $client;

test/unit/FilesExistTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace SendGrid\Test;
44

5-
class FilesExistTest extends \PHPUnit_Framework_TestCase
5+
use PHPUnit\Framework\TestCase;
6+
7+
class FilesExistTest extends TestCase
68
{
79
public function testFileArePresentInRepo()
810
{

test/unit/LicenceYearTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace SendGrid\Test;
44

5-
class LicenceYearTest extends \PHPUnit_Framework_TestCase
5+
use PHPUnit\Framework\TestCase;
6+
7+
class LicenceYearTest extends TestCase
68
{
79
public function testConstructor()
810
{

test/unit/ResponseTest.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
namespace SendGrid\Test;
44

55
use SendGrid\Response;
6+
use PHPUnit\Framework\TestCase;
67

7-
class ResponseTest extends \PHPUnit_Framework_TestCase
8+
class ResponseTest extends TestCase
89
{
910
public function testConstructor()
1011
{
1112
$response = new Response();
12-
13+
1314
$this->assertAttributeEquals(200, 'statusCode', $response);
1415
$this->assertAttributeEquals('', 'body', $response);
1516
$this->assertAttributeEquals([], 'headers', $response);
@@ -41,11 +42,11 @@ public function testHeaders()
4142

4243
$this->assertEquals(['Content-Type: text/html'], $response->headers());
4344
}
44-
45+
4546
public function testAssociativeHeaders()
4647
{
4748
$response = new Response(null, null, ['Content-Type: text/html', 'HTTP/1.1 200 OK']);
48-
49+
4950
$this->assertEquals(['Content-Type' => 'text/html', 'Status' => 'HTTP/1.1 200 OK'], $response->headers(true));
5051
}
5152
}

0 commit comments

Comments
 (0)