Skip to content

Commit 7c811b7

Browse files
authored
Merge pull request #224 from aik099/prophecy-phpunit9-compat
Fixed Prophecy-related deprecations on PHPUnit 9.x
2 parents 78fc187 + 2767dc7 commit 7c811b7

File tree

8 files changed

+74
-12
lines changed

8 files changed

+74
-12
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"aik099/coding-standard": "dev-master",
1919
"squizlabs/php_codesniffer": "^2.6",
2020
"yoast/phpunit-polyfills": "^1.0",
21-
"phpspec/prophecy": "^1.10"
21+
"phpspec/prophecy": "^1.10",
22+
"console-helpers/prophecy-phpunit": "^3.0"
2223
},
2324
"autoload": {
2425
"psr-4" : {

composer.lock

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Jira/AbstractTestCase.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Tests\chobie\Jira;
4+
5+
6+
use PHPUnit\Framework\TestCase;
7+
use Prophecy\PhpUnit\ProphecyTrait;
8+
9+
abstract class AbstractTestCase extends TestCase
10+
{
11+
12+
use ProphecyTrait;
13+
}

tests/Jira/Api/Authentication/BasicTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55

66
use chobie\Jira\Api\Authentication\Basic;
7-
use PHPUnit\Framework\TestCase;
87

9-
class BasicTest extends TestCase
8+
class BasicTest extends AbstractTestCase
109
{
1110

1211
public function testBasicAuthentication()

tests/Jira/Api/Client/AbstractClientTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
use chobie\Jira\Api\Authentication\AuthenticationInterface;
99
use chobie\Jira\Api\Authentication\Basic;
1010
use chobie\Jira\Api\Client\ClientInterface;
11-
use PHPUnit\Framework\TestCase;
11+
use Tests\chobie\Jira\AbstractTestCase;
1212
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
1313

14-
abstract class AbstractClientTestCase extends TestCase
14+
abstract class AbstractClientTestCase extends AbstractTestCase
1515
{
1616

1717
use ExpectException;

tests/Jira/ApiTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
use chobie\Jira\Api\Authentication\AuthenticationInterface;
88
use chobie\Jira\Api\Result;
99
use chobie\Jira\IssueType;
10-
use PHPUnit\Framework\TestCase;
1110
use Prophecy\Prophecy\ObjectProphecy;
1211

1312
/**
1413
* Class ApiTest
1514
*
1615
* @package Tests\chobie\Jira
1716
*/
18-
class ApiTest extends TestCase
17+
class ApiTest extends AbstractTestCase
1918
{
2019

2120
const ENDPOINT = 'http://jira.company.com';

tests/Jira/IssueTypeTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55

66
use chobie\Jira\IssueType;
7-
use PHPUnit\Framework\TestCase;
87
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
98

10-
class IssueTypeTest extends TestCase
9+
class IssueTypeTest extends AbstractTestCase
1110
{
1211
use ExpectException;
1312

tests/Jira/Issues/WalkerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
use chobie\Jira\Api\UnauthorizedException;
88
use chobie\Jira\Issue;
99
use chobie\Jira\Issues\Walker;
10-
use PHPUnit\Framework\TestCase;
1110
use Prophecy\Prophecy\ObjectProphecy;
11+
use Tests\chobie\Jira\AbstractTestCase;
1212
use Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains;
1313
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
1414

15-
class WalkerTest extends TestCase
15+
class WalkerTest extends AbstractTestCase
1616
{
1717

1818
use ExpectException, AssertStringContains;

0 commit comments

Comments
 (0)