Completed
Push — master ( 6dd6b9...53a464 )
by Andrii
12:52
created

ConnectionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 3
c 4
b 1
f 0
lcom 1
cbo 1
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 3 1
A testGetBaseUri() 0 7 1
1
<?php
2
/**
3
 * Tools to use API as ActiveRecord for Yii2
4
 *
5
 * @link      https://github.com/hiqdev/yii2-hiart
6
 * @package   yii2-hiart
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\hiart\tests\unit;
12
13
use hiqdev\hiart\rest\Connection;
14
15
/**
16
 * Connection test class.
17
 */
18
class ConnectionTest extends \PHPUnit_Framework_TestCase
19
{
20
    protected $shortUri = 'http://api.dev';
21
22
    protected $fixedUri = 'http://api.dev/';
23
24
    protected function setUp()
25
    {
26
        $this->db = new Connection();
27
    }
28
29
    protected function tearDown()
30
    {
31
    }
32
33
    public function testGetBaseUri()
34
    {
35
        $this->db->baseUri = $this->shortUri;
36
        $this->assertSame($this->fixedUri, $this->db->getBaseUri());
37
        $this->db->baseUri = $this->fixedUri;
38
        $this->assertSame($this->fixedUri, $this->db->getBaseUri());
39
    }
40
}
41