Skip to content

Commit c65b4ac

Browse files
committed
PHPUnit 6 compatibility
1 parent cfe2738 commit c65b4ac

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

tests/Phug/ReaderTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ public function testPeek()
199199

200200
/**
201201
* @covers ::peek
202+
* @expectedException \InvalidArgumentException
202203
*/
203204
public function testPeekThrowsExceptionOnInvalidArguments()
204205
{
205-
self::setExpectedException(\InvalidArgumentException::class);
206206
(new Reader('a'))->peek(0);
207207
}
208208

@@ -236,11 +236,11 @@ public function testMatch()
236236
* @covers ::match
237237
* @covers ::getPregErrorText
238238
* @covers ::throwException
239-
* @covers Phug\ReaderException
239+
* @covers \Phug\ReaderException
240+
* @expectedException \Phug\ReaderException
240241
*/
241242
public function testMatchFailsOnPregError()
242243
{
243-
self::setExpectedException(ReaderException::class);
244244
(new Reader('foobar foobar foobar'))->match('(?:\D+|<\d+>)*[!?]');
245245
}
246246

@@ -262,11 +262,11 @@ public function testGetMatch()
262262
/**
263263
* @covers ::getMatch
264264
* @covers ::throwException
265-
* @covers Phug\ReaderException
265+
* @covers \Phug\ReaderException
266+
* @expectedException \Phug\ReaderException
266267
*/
267268
public function testGetMatchCantOperateOnMissingMatchCall()
268269
{
269-
self::setExpectedException(ReaderException::class);
270270
(new Reader('a'))->getMatch('test');
271271
}
272272

@@ -284,11 +284,11 @@ public function testGetMatchData()
284284
/**
285285
* @covers ::getMatchData
286286
* @covers ::throwException
287-
* @covers Phug\ReaderException
287+
* @covers \Phug\ReaderException
288+
* @expectedException \Phug\ReaderException
288289
*/
289290
public function testGetMatchDataCantOperateOnMissingMatchCall()
290291
{
291-
self::setExpectedException(ReaderException::class);
292292
(new Reader('a'))->getMatchData();
293293
}
294294

@@ -323,11 +323,11 @@ public function testConsume()
323323
/**
324324
* @covers ::consume
325325
* @covers ::throwException
326-
* @covers Phug\ReaderException
326+
* @covers \Phug\ReaderException
327+
* @expectedException \Phug\ReaderException
327328
*/
328329
public function testConsumeThrowsExceptionOnInvalidConsumeLength()
329330
{
330-
self::setExpectedException(ReaderException::class);
331331
(new Reader('a'))->consume();
332332
}
333333

@@ -349,10 +349,10 @@ public function testReadWhile()
349349

350350
/**
351351
* @covers ::readWhile
352+
* @expectedException \InvalidArgumentException
352353
*/
353354
public function testReadWhileExpectsValidCallback()
354355
{
355-
self::setExpectedException(\InvalidArgumentException::class);
356356
(new Reader('a'))->readWhile('test');
357357
}
358358

@@ -646,13 +646,13 @@ public function testReadString()
646646
/**
647647
* @covers ::readString
648648
* @covers ::throwException
649-
* @covers Phug\ReaderException
649+
* @covers \Phug\ReaderException
650+
* @expectedException \Phug\ReaderException
650651
*
651652
* @dataProvider provideNotCorrectlyClosedStrings
652653
*/
653654
public function testReadStringFailsOnNotCorrectlyClosedStrings($string)
654655
{
655-
self::setExpectedException(ReaderException::class);
656656
(new Reader($string))->readString();
657657
}
658658

@@ -679,13 +679,13 @@ public function testReadExpression()
679679
/**
680680
* @covers ::readExpression
681681
* @covers ::throwException
682-
* @covers Phug\ReaderException
682+
* @covers \Phug\ReaderException
683+
* @expectedException \Phug\ReaderException
683684
*
684685
* @dataProvider provideNotCorrectlyClosedBrackets
685686
*/
686687
public function testReadExpressionFailsOnNotCorrectlyClosedBrackets($string)
687688
{
688-
self::setExpectedException(ReaderException::class);
689689
(new Reader($string))->readExpression([',']);
690690
}
691691

0 commit comments

Comments
 (0)