-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Drop PHP versions before 7.2 * Remove derprecaed phpunit code * Fixes according to review * Typo
- Loading branch information
Showing
5 changed files
with
15 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
use Error; | ||
use Exception; | ||
use LogicException; | ||
use PHPUnit\Framework\TestCase; | ||
use RuntimeException; | ||
use stdClass; | ||
use Webmozart\Assert\Assert; | ||
|
@@ -25,7 +26,7 @@ | |
* | ||
* @author Bernhard Schussek <[email protected]> | ||
*/ | ||
class AssertTest extends BaseTestCase | ||
class AssertTest extends TestCase | ||
{ | ||
private static $resource; | ||
|
||
|
@@ -422,7 +423,7 @@ public function getTests() | |
// no tests for readable()/writable() for now | ||
array('classExists', array(__CLASS__), true), | ||
array('classExists', array(__NAMESPACE__.'\Foobar'), false), | ||
array('subclassOf', array(__CLASS__, 'Webmozart\Assert\Tests\BaseTestCase'), true), | ||
array('subclassOf', array(__CLASS__, 'PHPUnit\Framework\TestCase'), true), | ||
array('subclassOf', array(__CLASS__, 'stdClass'), false), | ||
array('interfaceExists', array('\Countable'), true), | ||
array('interfaceExists', array(__CLASS__), false), | ||
|
@@ -598,7 +599,7 @@ public function testAssert($method, $args, $success, $multibyte = false, $minVer | |
} | ||
|
||
if (!$success) { | ||
$this->setExpectedException('\InvalidArgumentException'); | ||
$this->expectException('\InvalidArgumentException'); | ||
} | ||
|
||
call_user_func_array(array('Webmozart\Assert\Assert', $method), $args); | ||
|
@@ -620,7 +621,7 @@ public function testNullOr($method, $args, $success, $multibyte = false, $minVer | |
} | ||
|
||
if (!$success && null !== reset($args)) { | ||
$this->setExpectedException('\InvalidArgumentException'); | ||
$this->expectException('\InvalidArgumentException'); | ||
} | ||
|
||
call_user_func_array(array('Webmozart\Assert\Assert', 'nullOr'.ucfirst($method)), $args); | ||
|
@@ -651,7 +652,7 @@ public function testAllArray($method, $args, $success, $multibyte = false, $minV | |
} | ||
|
||
if (!$success) { | ||
$this->setExpectedException('\InvalidArgumentException'); | ||
$this->expectException('\InvalidArgumentException'); | ||
} | ||
|
||
$arg = array_shift($args); | ||
|
@@ -676,7 +677,7 @@ public function testAllTraversable($method, $args, $success, $multibyte = false, | |
} | ||
|
||
if (!$success) { | ||
$this->setExpectedException('\InvalidArgumentException'); | ||
$this->expectException('\InvalidArgumentException'); | ||
} | ||
|
||
$arg = array_shift($args); | ||
|
@@ -716,14 +717,15 @@ public function getStringConversions() | |
*/ | ||
public function testConvertValuesToStrings($method, $args, $exceptionMessage) | ||
{ | ||
$this->setExpectedException('\InvalidArgumentException', $exceptionMessage); | ||
$this->expectException('\InvalidArgumentException', $exceptionMessage); | ||
$this->expectExceptionMessage($exceptionMessage); | ||
|
||
call_user_func_array(array('Webmozart\Assert\Assert', $method), $args); | ||
} | ||
|
||
public function testAnUnknownMethodThrowsABadMethodCall() | ||
{ | ||
$this->setExpectedException('\BadMethodCallException'); | ||
$this->expectException('\BadMethodCallException'); | ||
|
||
Assert::nonExistentMethod(); | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters