Skip to content

Commit

Permalink
Bump phpunit to supported version
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Sep 9, 2019
1 parent d876019 commit 0077a9f
Show file tree
Hide file tree
Showing 50 changed files with 179 additions and 115 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.php_cs.cache
phpunit.xml
.phpunit.result.cache
composer.lock
composer.phar
vendor/*
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"php-http/cache-plugin": "^1.4"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpunit/phpunit": "^7.0 || ^8.0",
"php-http/guzzle6-adapter": "^1.0",
"php-http/mock-client": "^1.0",
"guzzlehttp/psr7": "^1.2",
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
Expand Down
4 changes: 2 additions & 2 deletions test/Github/Tests/Api/AbstractApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ public function shouldNotPassEmptyRefToClient()
$api = $this->getAbstractApiObject($client);
$actual = $this->getMethod($api, 'get')->invokeArgs($api, ['/path', ['ref' => null]]);

$this->assertInternalType('array', $actual);
$this->assertIsArray($actual);
}

/**
* @param $client
*
* @return \PHPUnit_Framework_MockObject_MockObject
* @return \PHPUnit\Framework\MockObject\MockObject
*/
protected function getAbstractApiObject($client)
{
Expand Down
9 changes: 6 additions & 3 deletions test/Github/Tests/Api/CurrentUser/DeployKeysTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\CurrentUser;

use Github\Exception\MissingArgumentException;
use Github\Tests\Api\TestCase;

class DeployKeysTest extends TestCase
{
Expand Down Expand Up @@ -55,10 +58,10 @@ public function shouldCreateKey()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateKeyWithoutTitleParam()
{
$this->expectException(MissingArgumentException::class);
$data = ['key' => 'ssh-rsa ...'];

$api = $this->getApiMock();
Expand All @@ -70,10 +73,10 @@ public function shouldNotCreateKeyWithoutTitleParam()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateKeyWithoutKeyParam()
{
$this->expectException(MissingArgumentException::class);
$data = ['title' => 'my key'];

$api = $this->getApiMock();
Expand Down
9 changes: 6 additions & 3 deletions test/Github/Tests/Api/CurrentUser/EmailsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\CurrentUser;

use Github\Exception\InvalidArgumentException;
use Github\Tests\Api\TestCase;

class EmailsTest extends TestCase
{
Expand Down Expand Up @@ -54,10 +57,10 @@ public function shouldRemoveEmails()

/**
* @test
* @expectedException \Github\Exception\InvalidArgumentException
*/
public function shouldNotRemoveEmailsWhenAreNotPass()
{
$this->expectException(InvalidArgumentException::class);
$api = $this->getApiMock();
$api->expects($this->any())
->method('delete');
Expand Down Expand Up @@ -99,10 +102,10 @@ public function shouldAddEmails()

/**
* @test
* @expectedException \Github\Exception\InvalidArgumentException
*/
public function shouldNotAddEmailsWhenAreNotPass()
{
$this->expectException(InvalidArgumentException::class);
$api = $this->getApiMock();
$api->expects($this->any())
->method('post');
Expand Down
4 changes: 3 additions & 1 deletion test/Github/Tests/Api/CurrentUser/FollowersTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\CurrentUser;

use Github\Tests\Api\TestCase;

class FollowersTest extends TestCase
{
Expand Down
4 changes: 3 additions & 1 deletion test/Github/Tests/Api/CurrentUser/MembershipsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\CurrentUser;

use Github\Tests\Api\TestCase;

class MembershipsTest extends TestCase
{
Expand Down
4 changes: 3 additions & 1 deletion test/Github/Tests/Api/CurrentUser/StarringTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\CurrentUser;

use Github\Tests\Api\TestCase;

class StarringTest extends TestCase
{
Expand Down
4 changes: 3 additions & 1 deletion test/Github/Tests/Api/CurrentUser/WatchersTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\CurrentUser;

use Github\Tests\Api\TestCase;

class WatchersTest extends TestCase
{
Expand Down
4 changes: 3 additions & 1 deletion test/Github/Tests/Api/DeploymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Github\Tests\Api;

use Github\Exception\MissingArgumentException;

class DeploymentTest extends TestCase
{
/**
Expand Down Expand Up @@ -79,10 +81,10 @@ public function shouldCreateStatusUpdate()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldRejectStatusUpdateWithoutStateField()
{
$this->expectException(MissingArgumentException::class);
$api = $this->getApiMock();
$statusData = ['description' => 'waiting to start'];

Expand Down
4 changes: 3 additions & 1 deletion test/Github/Tests/Api/GistsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Github\Tests\Api;

use Github\Exception\MissingArgumentException;

class GistsTest extends TestCase
{
/**
Expand Down Expand Up @@ -128,10 +130,10 @@ public function shouldListGistForks()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateGistWithoutFile()
{
$this->expectException(MissingArgumentException::class);
$input = [
'description' => '',
'public' => false,
Expand Down
9 changes: 6 additions & 3 deletions test/Github/Tests/Api/GitData/BlobsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\GitData;

use Github\Exception\MissingArgumentException;
use Github\Tests\Api\TestCase;

class BlobsTest extends TestCase
{
Expand Down Expand Up @@ -67,10 +70,10 @@ public function shouldCreateBlob()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateBlobWithoutEncoding()
{
$this->expectException(MissingArgumentException::class);
$data = ['content' => 'some cotent'];

$api = $this->getApiMock();
Expand All @@ -82,10 +85,10 @@ public function shouldNotCreateBlobWithoutEncoding()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateBlobWithoutContent()
{
$this->expectException(MissingArgumentException::class);
$data = ['encoding' => 'utf8'];

$api = $this->getApiMock();
Expand Down
11 changes: 7 additions & 4 deletions test/Github/Tests/Api/GitData/CommitsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\GitData;

use Github\Exception\MissingArgumentException;
use Github\Tests\Api\TestCase;

class CommitsTest extends TestCase
{
Expand Down Expand Up @@ -39,10 +42,10 @@ public function shouldCreateCommit()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateCommitWithoutMessageParam()
{
$this->expectException(MissingArgumentException::class);
$data = ['tree' => 1234, 'parents' => []];

$api = $this->getApiMock();
Expand All @@ -54,10 +57,10 @@ public function shouldNotCreateCommitWithoutMessageParam()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateCommitWithoutTreeParam()
{
$this->expectException(MissingArgumentException::class);
$data = ['message' => 'some message', 'parents' => []];

$api = $this->getApiMock();
Expand All @@ -69,10 +72,10 @@ public function shouldNotCreateCommitWithoutTreeParam()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateCommitWithoutParentsParam()
{
$this->expectException(MissingArgumentException::class);
$data = ['message' => 'some message', 'tree' => '12334'];

$api = $this->getApiMock();
Expand Down
11 changes: 7 additions & 4 deletions test/Github/Tests/Api/GitData/ReferencesTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Github\Tests\Api;
namespace Github\Tests\Api\GitData;

use Github\Exception\MissingArgumentException;
use Github\Tests\Api\TestCase;

class ReferencesTest extends TestCase
{
Expand Down Expand Up @@ -119,10 +122,10 @@ public function shouldCreateReference()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateReferenceWithoutShaParam()
{
$this->expectException(MissingArgumentException::class);
$data = ['ref' => '123'];

$api = $this->getApiMock();
Expand All @@ -134,10 +137,10 @@ public function shouldNotCreateReferenceWithoutShaParam()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateReferenceWithoutRefsParam()
{
$this->expectException(MissingArgumentException::class);
$data = ['sha' => '1234'];

$api = $this->getApiMock();
Expand Down Expand Up @@ -166,10 +169,10 @@ public function shouldUpdateReference()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNoUpdateReferenceWithoutSha()
{
$this->expectException(MissingArgumentException::class);
$data = [];

$api = $this->getApiMock();
Expand Down
Loading

0 comments on commit 0077a9f

Please sign in to comment.