Issues (65)

tests/unit/ConnectionTest.php (1 issue)

1
<?php
2
/**
3
 * ActiveRecord for API
4
 *
5
 * @link      https://github.com/hiqdev/yii2-hiart
6
 * @package   yii2-hiart
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, 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();
0 ignored issues
show
Bug Best Practice introduced by
The property db does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
27
    }
28
29
    protected function tearDown()
30
    {
31
    }
32
33
    public function testShortBaseUri()
34
    {
35
        $this->db->baseUri = $this->shortUri;
36
        $this->assertSame($this->fixedUri, $this->db->getBaseUri());
37
    }
38
39
    public function testFixedBaseUri()
40
    {
41
        $this->db->baseUri = $this->fixedUri;
42
        $this->assertSame($this->fixedUri, $this->db->getBaseUri());
43
    }
44
}
45