Skip to content

Commit f9af9f5

Browse files
committed
Allow PHPUnit 8
1 parent 247b867 commit f9af9f5

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"php-http/mock-client": "^1.0",
3737
"phpstan/phpstan-shim": "^0.11",
3838
"phpstan/phpstan-phpunit": "^0.11",
39-
"phpunit/phpunit": "^7.5",
39+
"phpunit/phpunit": "^7.5||^8.5",
4040
"symfony/browser-kit": "^3.4||^4.0||^5.0",
4141
"symfony/expression-language": "^3.4||^4.0||^5.0",
4242
"symfony/framework-bundle": "^3.4||^4.0||^5.0",

phpunit.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.5/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd"
55
colors="true"
66
backupGlobals="false"
77
bootstrap="vendor/autoload.php"
8+
cacheResult="false"
89
processIsolation="true"
910
>
1011

test/ErrorTypesParserTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class ErrorTypesParserTest extends TestCase
99
{
1010
/**
1111
* @dataProvider parsableValueProvider
12+
* @param int|string $value
1213
*/
13-
public function testParse(string $value, int $expected): void
14+
public function testParse($value, int $expected): void
1415
{
1516
$ex = new ErrorTypesParser($value);
1617
$this->assertEquals($expected, $ex->parse());

test/EventListener/ConsoleListenerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@
88
use Sentry\SentryBundle\Test\BaseTestCase;
99
use Sentry\State\HubInterface;
1010
use Sentry\State\Scope;
11+
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1112
use Symfony\Component\Console\Command\Command;
1213
use Symfony\Component\Console\Event\ConsoleCommandEvent;
1314
use Symfony\Component\Console\Input\InputInterface;
1415
use Symfony\Component\Console\Output\OutputInterface;
1516

1617
class ConsoleListenerTest extends BaseTestCase
1718
{
19+
use SetUpTearDownTrait;
20+
1821
private $currentHub;
1922
private $currentScope;
2023

21-
protected function setUp()
24+
protected function doSetUp(): void
2225
{
23-
parent::setUp();
24-
2526
$this->currentScope = $scope = new Scope();
2627
$this->currentHub = $this->prophesize(HubInterface::class);
2728
$this->currentHub->configureScope(Argument::type('callable'))

test/EventListener/RequestListenerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Sentry\SentryBundle\Test\BaseTestCase;
1111
use Sentry\State\HubInterface;
1212
use Sentry\State\Scope;
13+
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1314
use Symfony\Component\HttpFoundation\Request;
1415
use Symfony\Component\HttpKernel\Event\ControllerEvent;
1516
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
@@ -20,14 +21,14 @@
2021

2122
class RequestListenerTest extends BaseTestCase
2223
{
24+
use SetUpTearDownTrait;
25+
2326
private $currentScope;
2427
private $currentHub;
2528
private $options;
2629

27-
protected function setUp()
30+
protected function doSetUp(): void
2831
{
29-
parent::setUp();
30-
3132
$this->currentScope = $scope = new Scope();
3233
$this->currentHub = $this->prophesize(HubInterface::class);
3334

test/EventListener/SubRequestListenerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
use Sentry\SentryBundle\Test\BaseTestCase;
77
use Sentry\State\HubInterface;
88
use Sentry\State\Scope;
9+
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
910
use Symfony\Component\HttpFoundation\Request;
1011
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
1112
use Symfony\Component\HttpKernel\KernelInterface;
1213

1314
class SubRequestListenerTest extends BaseTestCase
1415
{
16+
use SetUpTearDownTrait;
17+
1518
private $currentHub;
1619

17-
protected function setUp()
20+
protected function doSetUp(): void
1821
{
19-
parent::setUp();
20-
2122
$this->currentHub = $this->prophesize(HubInterface::class);
2223

2324
$this->setCurrentHub($this->currentHub->reveal());

0 commit comments

Comments
 (0)