Completed
Push — master ( 517f9d...7f2894 )
by Tobias
05:43
created

LocoProjectTest::testWithEmptyConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[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 Translation\PlatformAdapter\Loco\Tests\Unit\Model;
13
14
use PHPUnit\Framework\TestCase;
15 3
use Translation\PlatformAdapter\Loco\Model\LocoProject;
16
17 3
class LocoProjectTest extends TestCase
18 3
{
19
    /**
20 1
     * @var LocoProject
21
     */
22 1
    private $locoProject;
23 1
24
    public function setUp()
25 1
    {
26
        $this->locoProject = new LocoProject('domain', ['api_key' => 'test', 'index_parameter' => 'text']);
27 1
    }
28 1
29
    public function testWithEmptyConfig()
30 1
    {
31
        $locoProject = new LocoProject('domain', []);
32 1
        $this->assertNull($locoProject->getIndexParameter());
33 1
        $this->assertNull($locoProject->getApiKey());
34
    }
35
36
    public function testGetName()
37
    {
38
        $this->assertEquals('domain', $this->locoProject->getName());
39
    }
40
41
    public function testGetApiKey()
42
    {
43
        $this->assertEquals('test', $this->locoProject->getApiKey());
44
    }
45
46
    public function testGetIndexParameter()
47
    {
48
        $this->assertEquals('text', $this->locoProject->getIndexParameter());
49
    }
50
}
51