Skip to content

test: test enhancements #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": "^5.7 || ^6.5",
"sebastian/version": "^1.0.6",
"squizlabs/php_codesniffer": "~2.0",
"friendsofphp/php-cs-fixer": "^2.16"
Expand Down
13 changes: 13 additions & 0 deletions test/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="../vendor/autoload.php">
<testsuites>
<testsuite name="All">
<directory>.</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../lib</directory>
</whitelist>
</filter>
</phpunit>
3 changes: 2 additions & 1 deletion test/unit/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

namespace SendGrid\Test;

use PHPUnit\Framework\TestCase;
use SendGrid\Client;
use SendGrid\Exception\InvalidRequest;

class ClientTest extends \PHPUnit_Framework_TestCase
class ClientTest extends TestCase
{
/** @var MockClient */
private $client;
Expand Down
4 changes: 3 additions & 1 deletion test/unit/FilesExistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace SendGrid\Test;

class FilesExistTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class FilesExistTest extends TestCase
{
public function testFileArePresentInRepo()
{
Expand Down
4 changes: 3 additions & 1 deletion test/unit/LicenceYearTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace SendGrid\Test;

class LicenceYearTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class LicenceYearTest extends TestCase
{
public function testConstructor()
{
Expand Down
9 changes: 5 additions & 4 deletions test/unit/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace SendGrid\Test;

use SendGrid\Response;
use PHPUnit\Framework\TestCase;

class ResponseTest extends \PHPUnit_Framework_TestCase
class ResponseTest extends TestCase
{
public function testConstructor()
{
$response = new Response();

$this->assertAttributeEquals(200, 'statusCode', $response);
$this->assertAttributeEquals('', 'body', $response);
$this->assertAttributeEquals([], 'headers', $response);
Expand Down Expand Up @@ -41,11 +42,11 @@ public function testHeaders()

$this->assertEquals(['Content-Type: text/html'], $response->headers());
}

public function testAssociativeHeaders()
{
$response = new Response(null, null, ['Content-Type: text/html', 'HTTP/1.1 200 OK']);

$this->assertEquals(['Content-Type' => 'text/html', 'Status' => 'HTTP/1.1 200 OK'], $response->headers(true));
}
}