Completed
Branch 2.0.1 (3659a8)
by Serhii
03:59
created

RobotTest::testGoogleBot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 13
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 9.4285
1
<?php
2
/**
3
 * @author Sergey Nehaenko <[email protected]>
4
 * @license GPL
5
 * @copyright Sergey Nehaenko &copy 2016
6
 * @version 1.0
7
 * @project browser-detector
8
 */
9
10
namespace EndorphinStudio\Tests;
11
12
13
class RobotTest extends \PHPUnit_Framework_TestCase
14
{
15
16
    /**
17
     * Test Tine RSS
18
     */
19
    public function testTinyRSS()
20
    {
21
        $ualist = array(
22
            'Tiny Tiny RSS/1.10 (http://tt-rss.org/)'
23
        );
24
25
        testUaList($this,'Robot','Name',$ualist,'Tiny RSS');
26
    }
27
    /**
28
     * Test Google Bots
29
     */
30
    public function testGoogleBot()
31
    {
32
        $ualist = array(
33
            'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
34
            'Googlebot/2.1 (+http://www.google.com/bot.html)',
35
            'Googlebot-News',
36
            'Googlebot-Image/1.0',
37
            'Googlebot-Video/1.0',
38
            'SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)',
39
            'DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)',
40
            'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
41
            '(compatible; Mediapartners-Google/2.1; +http://www.google.com/bot.html)',
42
            'Mediapartners-Google'
43
        );
44
45
        testUaList($this,'Robot','Owner',$ualist,'Google Inc.');
46
    }
47
    /**
48
     * Test Yandex Bots
49
     */
50
    public function testYandexBot()
51
    {
52
        $ualist = array(
53
            'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots) ',
54
            'Mozilla/5.0 (iPhone; CPU iPhone OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B411 Safari/600.1.4 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
55
            'Mozilla/5.0 (compatible; YandexAccessibilityBot/3.0; +http://yandex.com/bots)',
56
            'Mozilla/5.0 (iPhone; CPU iPhone OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B411 Safari/600.1.4 (compatible; YandexMobileBot/3.0; +http://yandex.com/bots)',
57
            'Mozilla/5.0 (compatible; YandexDirectDyn/1.0; +http://yandex.com/bots',
58
            'Mozilla/5.0 (compatible; YandexScreenshotBot/3.0; +http://yandex.com/bots)',
59
            'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
60
            'Mozilla/5.0 (compatible; YandexVideo/3.0; +http://yandex.com/bots)',
61
            'Mozilla/5.0 (compatible; YandexMedia/3.0; +http://yandex.com/bots)',
62
            'Mozilla/5.0 (compatible; YandexBlogs/0.99; robot; +http://yandex.com/bots)',
63
            'Mozilla/5.0 (compatible; YandexFavicons/1.0; +http://yandex.com/bots)',
64
            'Mozilla/5.0 (compatible; YandexWebmaster/2.0; +http://yandex.com/bots)',
65
            'Mozilla/5.0 (compatible; YandexPagechecker/1.0; +http://yandex.com/bots)',
66
            'Mozilla/5.0 (compatible; YandexImageResizer/2.0; +http://yandex.com/bots)',
67
            'Mozilla/5.0 (compatible; YandexAdNet/1.0; +http://yandex.com/bots)',
68
            'Mozilla/5.0 (compatible; YandexDirect/3.0; +http://yandex.com/bots)',
69
            'Mozilla/5.0 (compatible; YaDirectFetcher/1.0; Dyatel; +http://yandex.com/bots)',
70
            'Mozilla/5.0 (compatible; YandexCalendar/1.0; +http://yandex.com/bots)',
71
            'Mozilla/5.0 (compatible; YandexSitelinks; Dyatel; +http://yandex.com/bots)',
72
            'Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots)',
73
            'Mozilla/5.0 (compatible; YandexNews/3.0; +http://yandex.com/bots)',
74
            'Mozilla/5.0 (compatible; YandexNewslinks; +http://yandex.com/bots)',
75
            'Mozilla/5.0 (compatible; YandexCatalog/3.0; +http://yandex.com/bots)',
76
            'Mozilla/5.0 (compatible; YandexAntivirus/2.0; +http://yandex.com/bots)',
77
            'Mozilla/5.0 (compatible; YandexMarket/1.0; +http://yandex.com/bots)',
78
            'Mozilla/5.0 (compatible; YandexVertis/3.0; +http://yandex.com/bots)',
79
            'Mozilla/5.0 (compatible; YandexForDomain/1.0; +http://yandex.com/bots)',
80
            'Mozilla/5.0 (compatible; YandexBot/3.0; MirrorDetector; +http://yandex.com/bots)',
81
            'Mozilla/5.0 (compatible; YandexSpravBot/1.0; +http://yandex.com/bots)'
82
        );
83
84
        testUaList($this,'Robot','Owner',$ualist,'Yandex LLC.');
85
    }
86
}
87