Skip to content

Commit 27a152e

Browse files
committed
Match not found test
1 parent c5aec87 commit 27a152e

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

tests/MatchNotFoundTest.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
namespace vipnytt\UserAgentParser\Tests;
3+
4+
use vipnytt\UserAgentParser;
5+
6+
/**
7+
* Class MatchNotFoundTest
8+
*
9+
* @package vipnytt\UserAgentParser\Tests
10+
*/
11+
class MatchNotFoundTest extends \PHPUnit_Framework_TestCase
12+
{
13+
/**
14+
* @dataProvider generateDataForTest
15+
* @param string $userAgent
16+
* @param array $array
17+
*/
18+
public function testMatchNotFound($userAgent, $array)
19+
{
20+
$parser = new UserAgentParser($userAgent);
21+
$this->assertInstanceOf('vipnytt\UserAgentParser', $parser);
22+
$this->assertFalse($parser->match($array));
23+
}
24+
25+
/**
26+
* Generate test data
27+
* @return array
28+
*/
29+
public
30+
function generateDataForTest()
31+
{
32+
return [
33+
[
34+
'googlebot',
35+
[
36+
'googlebot-news',
37+
'googlebot-images',
38+
'googlebot/2.0',
39+
]
40+
]
41+
];
42+
}
43+
}

0 commit comments

Comments
 (0)