UserAgentTest::testGetUserAgent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Bouncer package.
5
 *
6
 * (c) François Hodierne <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bouncer;
13
14
class UserAgentTest extends \PHPUnit_Framework_TestCase
15
{
16
17
    public function testGetUserAgent()
18
    {
19
        $ua = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0';
20
21
        $server = array();
22
        $server['HTTP_USER_AGENT'] = $ua;
23
24
        $request = new \Bouncer\Request;
25
        $request->initialize(array(), array(), array(), array(), array(), $server);
26
27
        $this->assertEquals($request->getUserAgent(), $ua);
28
    }
29
30
}
31