|
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(): void |
|
25
|
1 |
|
{ |
|
26
|
|
|
$this->locoProject = new LocoProject('domain', ['api_key' => 'test', 'status' => '!untranslated,!rejected', '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 testGetStatus() |
|
47
|
|
|
{ |
|
48
|
|
|
$this->assertEquals('!untranslated,!rejected', $this->locoProject->getStatus()); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function testGetIndexParameter() |
|
52
|
|
|
{ |
|
53
|
|
|
$this->assertEquals('text', $this->locoProject->getIndexParameter()); |
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|