diff options
author | Jordi Boggiano <j.boggiano@seld.be> | 2016-05-20 19:43:01 +0100 |
---|---|---|
committer | Jordi Boggiano <j.boggiano@seld.be> | 2016-05-20 19:43:01 +0100 |
commit | f19fffe870646f013b650cbefde18985e73f6208 (patch) | |
tree | 10a824da1566ef5eff56a0e3f11fdc2bba7b34dd /tests/Monolog/Handler/RotatingFileHandlerTest.php | |
parent | 7a6510550560a9eb9ff7d732e907f4464f16cdb0 (diff) | |
parent | 1841e2ba88bd89df56277a1402aebb7ab61eef7b (diff) | |
download | monolog-f19fffe870646f013b650cbefde18985e73f6208.zip monolog-f19fffe870646f013b650cbefde18985e73f6208.tar.gz monolog-f19fffe870646f013b650cbefde18985e73f6208.tar.bz2 |
Merge remote-tracking branch 'rpkamp/master'
Diffstat (limited to 'tests/Monolog/Handler/RotatingFileHandlerTest.php')
-rw-r--r-- | tests/Monolog/Handler/RotatingFileHandlerTest.php | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/Monolog/Handler/RotatingFileHandlerTest.php b/tests/Monolog/Handler/RotatingFileHandlerTest.php index 96e6dff..495d500 100644 --- a/tests/Monolog/Handler/RotatingFileHandlerTest.php +++ b/tests/Monolog/Handler/RotatingFileHandlerTest.php @@ -11,6 +11,7 @@ namespace Monolog\Handler; +use InvalidArgumentException; use Monolog\TestCase; use PHPUnit_Framework_Error_Deprecated; @@ -141,15 +142,10 @@ class RotatingFileHandlerTest extends TestCase public function testAllowOnlyFixedDefinedDateFormats($dateFormat, $valid) { $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2); - $handler->setFilenameFormat('{filename}-{date}', $dateFormat); if (!$valid) { - $this->assertErrorWasTriggered( - E_USER_DEPRECATED, - 'Invalid date format - format should be one of '. - 'RotatingFileHandler::FILE_PER_DAY, RotatingFileHandler::FILE_PER_MONTH '. - 'or RotatingFileHandler::FILE_PER_YEAR.' - ); + $this->setExpectedExceptionRegExp(InvalidArgumentException::class, '~^Invalid date format~'); } + $handler->setFilenameFormat('{filename}-{date}', $dateFormat); } public function dateFormatProvider() @@ -169,13 +165,11 @@ class RotatingFileHandlerTest extends TestCase public function testDisallowFilenameFormatsWithoutDate($filenameFormat, $valid) { $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2); - $handler->setFilenameFormat($filenameFormat, RotatingFileHandler::FILE_PER_DAY); if (!$valid) { - $this->assertErrorWasTriggered( - E_USER_DEPRECATED, - 'Invalid filename format - format should contain at least `{date}`, because otherwise rotating is impossible.' - ); + $this->setExpectedExceptionRegExp(InvalidArgumentException::class, '~^Invalid filename format~'); } + + $handler->setFilenameFormat($filenameFormat, RotatingFileHandler::FILE_PER_DAY); } public function filenameFormatProvider() |