diff options
Diffstat (limited to 'tests/PHPUnit/Integration/Period/FactoryTest.php')
-rw-r--r-- | tests/PHPUnit/Integration/Period/FactoryTest.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/PHPUnit/Integration/Period/FactoryTest.php b/tests/PHPUnit/Integration/Period/FactoryTest.php index 470cacccd1..c83b231c82 100644 --- a/tests/PHPUnit/Integration/Period/FactoryTest.php +++ b/tests/PHPUnit/Integration/Period/FactoryTest.php @@ -100,21 +100,19 @@ class FactoryTest extends IntegrationTestCase $this->assertInstanceOf(TestPeriod::class, $period); } - /** - * @expectedException \Exception - * @expectedExceptionMessage General_ExceptionInvalidPeriod - */ public function test_build_ThrowsIfPeriodIsUnrecognized() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('General_ExceptionInvalidPeriod'); + Period\Factory::build('garbageperiod', '2015-01-01'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage General_ExceptionInvalidPeriod - */ public function test_build_ThrowsIfPeriodIsNotEnabledForApi() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('General_ExceptionInvalidPeriod'); + Config::getInstance()->General['enabled_periods_API'] = 'day'; Period\Factory::build('week', '2015-01-01'); } |