Completed
Push — master ( 17598f...abee1f )
by Kirill
13s queued 11s
created

ExportTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 12
c 2
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testReset() 0 13 1
A tearDown() 0 6 2
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Framework\I18n;
13
14
use Spiral\Tests\Framework\ConsoleTest;
15
16
class ExportTest extends ConsoleTest
17
{
18
    public function tearDown(): void
19
    {
20
        parent::tearDown();
21
22
        if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) {
23
            unlink(sys_get_temp_dir() . '/messages.ru.php');
24
        }
25
    }
26
27
    public function testReset(): void
28
    {
29
        $this->assertFalse(is_file(sys_get_temp_dir() . '/messages.ru.php'));
30
31
        $this->runCommandDebug('i18n:index');
32
        $this->runCommandDebug('configure');
33
34
        $this->runCommandDebug(
35
            'i18n:export',
36
            [
37
                'locale'     => 'ru',
38
                'path'       => sys_get_temp_dir(),
39
                '--fallback' => 'en',
40
            ]
41
        );
42
    }
43
}
44