Skip to content

Commit

Permalink
Merge pull request #224 from aik099/prophecy-phpunit9-compat
Browse files Browse the repository at this point in the history
Fixed Prophecy-related deprecations on PHPUnit 9.x
  • Loading branch information
aik099 authored Jan 2, 2025
2 parents 78fc187 + 2767dc7 commit 7c811b7
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 12 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"aik099/coding-standard": "dev-master",
"squizlabs/php_codesniffer": "^2.6",
"yoast/phpunit-polyfills": "^1.0",
"phpspec/prophecy": "^1.10"
"phpspec/prophecy": "^1.10",
"console-helpers/prophecy-phpunit": "^3.0"
},
"autoload": {
"psr-4" : {
Expand Down
53 changes: 52 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tests/Jira/AbstractTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Tests\chobie\Jira;


use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

abstract class AbstractTestCase extends TestCase
{

use ProphecyTrait;
}
3 changes: 1 addition & 2 deletions tests/Jira/Api/Authentication/BasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@


use chobie\Jira\Api\Authentication\Basic;
use PHPUnit\Framework\TestCase;

class BasicTest extends TestCase
class BasicTest extends AbstractTestCase
{

public function testBasicAuthentication()
Expand Down
4 changes: 2 additions & 2 deletions tests/Jira/Api/Client/AbstractClientTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use chobie\Jira\Api\Authentication\AuthenticationInterface;
use chobie\Jira\Api\Authentication\Basic;
use chobie\Jira\Api\Client\ClientInterface;
use PHPUnit\Framework\TestCase;
use Tests\chobie\Jira\AbstractTestCase;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;

abstract class AbstractClientTestCase extends TestCase
abstract class AbstractClientTestCase extends AbstractTestCase
{

use ExpectException;
Expand Down
3 changes: 1 addition & 2 deletions tests/Jira/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
use chobie\Jira\Api\Authentication\AuthenticationInterface;
use chobie\Jira\Api\Result;
use chobie\Jira\IssueType;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;

/**
* Class ApiTest
*
* @package Tests\chobie\Jira
*/
class ApiTest extends TestCase
class ApiTest extends AbstractTestCase
{

const ENDPOINT = 'http://jira.company.com';
Expand Down
3 changes: 1 addition & 2 deletions tests/Jira/IssueTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@


use chobie\Jira\IssueType;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;

class IssueTypeTest extends TestCase
class IssueTypeTest extends AbstractTestCase
{
use ExpectException;

Expand Down
4 changes: 2 additions & 2 deletions tests/Jira/Issues/WalkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use chobie\Jira\Api\UnauthorizedException;
use chobie\Jira\Issue;
use chobie\Jira\Issues\Walker;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Tests\chobie\Jira\AbstractTestCase;
use Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;

class WalkerTest extends TestCase
class WalkerTest extends AbstractTestCase
{

use ExpectException, AssertStringContains;
Expand Down

0 comments on commit 7c811b7

Please sign in to comment.