Skip to content

Commit eeb2fbf

Browse files
committed
more phpunit fixes
1 parent 33d846d commit eeb2fbf

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

tests/functional/cURLTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,21 @@ public function digestAuth()
130130
#[Test]
131131
public function throwsExceptionOnCurlError()
132132
{
133-
$this->setExpectedException('anlutro\cURL\cURLException', 'cURL request failed with error [7]:');
133+
$this->expectException('anlutro\cURL\cURLException', 'cURL request failed with error [7]:');
134134
$this->makeCurl()->get('http://0.0.0.0');
135135
}
136136

137137
#[Test]
138138
public function throwsExceptionWithMissingUrl()
139139
{
140-
$this->setExpectedException('BadMethodCallException', 'Missing argument 1 ($url) for anlutro\cURL\cURL::get');
140+
$this->expectException('BadMethodCallException', 'Missing argument 1 ($url) for anlutro\cURL\cURL::get');
141141
$this->makeCurl()->get();
142142
}
143143

144144
#[Test]
145145
public function throwsExceptionWhenDataProvidedButNotAllowed()
146146
{
147-
$this->setExpectedException('InvalidArgumentException', 'HTTP method [options] does not allow POST data.');
147+
$this->expectException('InvalidArgumentException', 'HTTP method [options] does not allow POST data.');
148148
$this->makeCurl()->options('http://localhost', array('foo' => 'bar'));
149149
}
150150

tests/unit/RequestTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,17 @@ public function headersAreCaseInsensitive()
7575
$this->assertEquals(array('foo' => 'bar'), $r->getHeaders());
7676
}
7777

78-
/**
79-
* @test
80-
* @expectedException InvalidArgumentException
81-
*/
78+
#[Test]
8279
public function invalidMethod()
8380
{
81+
$this->expectException("InvalidArgumentException");
8482
$this->makeRequest()->setMethod('foo');
8583
}
8684

87-
/**
88-
* @test
89-
* @expectedException InvalidArgumentException
90-
*/
85+
#[Test]
9186
public function invalidEncoding()
9287
{
88+
$this->expectException("InvalidArgumentException");
9389
$this->makeRequest()->setEncoding(999);
9490
}
9591

0 commit comments

Comments
 (0)