diff options
Diffstat (limited to 'tests/PHPUnit/Unit/Validator/DateTimeTest.php')
-rw-r--r-- | tests/PHPUnit/Unit/Validator/DateTimeTest.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/PHPUnit/Unit/Validator/DateTimeTest.php b/tests/PHPUnit/Unit/Validator/DateTimeTest.php index b430efd786..607cebf736 100644 --- a/tests/PHPUnit/Unit/Validator/DateTimeTest.php +++ b/tests/PHPUnit/Unit/Validator/DateTimeTest.php @@ -15,7 +15,7 @@ use Piwik\Validators\DateTime; * @group DateTime * @group DateTimeTest */ -class DateTimeTest extends \PHPUnit_Framework_TestCase +class DateTimeTest extends \PHPUnit\Framework\TestCase { public function test_validate_successValueNotEmpty() { @@ -23,21 +23,25 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase $this->validate('2014-05-06T10:13:14'); $this->validate('2014-05-06 10:13:14Z'); $this->validate('2014-05-06T10:13:14Z'); + + $this->assertTrue(true); } public function test_validate_successValueMayBeEmpty() { $this->validate(false); $this->validate(''); + + $this->assertTrue(true); } /** * @dataProvider getWrongFormat - * @expectedException \Piwik\Validators\Exception - * @expectedExceptionMessage General_ValidatorErrorInvalidDateTimeFormat */ public function test_validate_failInvalidFormat($date) { + $this->expectException(\Piwik\Validators\Exception::class); + $this->expectExceptionMessage('General_ValidatorErrorInvalidDateTimeFormat'); $this->validate($date); } @@ -56,12 +60,10 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase ); } - /** - * @expectedException \Piwik\Validators\Exception - * @expectedExceptionMessage General_ExceptionInvalidDateFormat - */ public function test_validate_invalidDate() { + $this->expectException(\Piwik\Validators\Exception::class); + $this->expectExceptionMessage('General_ExceptionInvalidDateFormat'); $this->validate('2014-15-26 90:43:32'); } |