diff --git a/tests/ExceptionMBStringTest.php b/tests/ExceptionMBStringTest.php new file mode 100644 index 0000000..4c92548 --- /dev/null +++ b/tests/ExceptionMBStringTest.php @@ -0,0 +1,23 @@ +<?php +namespace vipnytt\UserAgentParser\Tests; + +use vipnytt\UserAgentParser; + +/** + * Class ExceptionMBStringTest + * + * @package vipnytt\UserAgentParser\Tests + */ +class ExceptionMBStringTest extends \PHPUnit_Framework_TestCase +{ + /** + * Test if exception is thrown when extension `mbstring` is not loaded + */ + public function testExceptionMBString() + { + if (!extension_loaded('mbstring')) { + $this->expectException('\Exception'); + new UserAgentParser('SitemapParser'); + } + } +} diff --git a/tests/VersionTest.php b/tests/VersionTest.php index 2a58a32..32fac96 100644 --- a/tests/VersionTest.php +++ b/tests/VersionTest.php @@ -37,6 +37,10 @@ function generateDataForTest() [ 'bingbot/2.0', 'bingbot', + ], + [ + 'mybot', + 'mybot', ] ]; }