File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments