Skip to content

Commit 6e20d0f

Browse files
committed
Updated tests
1 parent 041dd4d commit 6e20d0f

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

tests/ExceptionMBStringTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
namespace vipnytt\UserAgentParser\Tests;
3+
4+
use vipnytt\UserAgentParser;
5+
6+
/**
7+
* Class ExceptionMBStringTest
8+
*
9+
* @package vipnytt\UserAgentParser\Tests
10+
*/
11+
class ExceptionMBStringTest extends \PHPUnit_Framework_TestCase
12+
{
13+
/**
14+
* Test if exception is thrown when extension `mbstring` is not loaded
15+
*/
16+
public function testExceptionMBString()
17+
{
18+
if (!extension_loaded('mbstring')) {
19+
$this->expectException('\Exception');
20+
new UserAgentParser('SitemapParser');
21+
}
22+
}
23+
}

tests/VersionTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ function generateDataForTest()
3737
[
3838
'bingbot/2.0',
3939
'bingbot',
40+
],
41+
[
42+
'mybot',
43+
'mybot',
4044
]
4145
];
4246
}

0 commit comments

Comments
 (0)