8000 Replace calls to setExpectedException by Pollyfill · symfony/browser-kit@6a05eff · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a05eff

Browse files
committed
Replace calls to setExpectedException by Pollyfill
1 parent 53266c9 commit 6a05eff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Tests/CookieTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
namespace Symfony\Component\BrowserKit\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\BrowserKit\Cookie;
1617

1718
class CookieTest extends TestCase
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
public function testToString()
2023
{
2124
$cookie = new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true);
@@ -100,7 +103,7 @@ public function testFromStringWithUrl()
100103

101104
public function testFromStringThrowsAnExceptionIfCookieIsNotValid()
102105
{
103-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
106+
$this->expectException('InvalidArgumentException');
104107
Cookie::fromString('foo');
105108
}
106109

@@ -113,7 +116,7 @@ public function testFromStringIgnoresInvalidExpiresDate()
113116

114117
public function testFromStringThrowsAnExceptionIfUrlIsNotValid()
115118
{
116-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
119+
$this->expectException('InvalidArgumentException');
117120
Cookie::fromString('foo=bar', 'foobar');
118121
}
119122

0 commit comments

Comments
 (0)
0