Passed
Pull Request — master (#277)
by Kirill
03:11
created

CleanTest::testClean()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
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\Framework;
13
14
use Spiral\Tests\Framework\ConsoleTest;
15
16
/**
17
 * @covers \Spiral\Command\CleanCommand
18
 */
19
class CleanTest extends ConsoleTest
20
{
21
    public function testClean(): void
22
    {
23
        $this->runCommand('configure');
24
25
        $output = $this->runCommand('cache:clean');
26
        $this->assertStringContainsString('Runtime cache has been cleared', $output);
27
    }
28
29
    public function testClean2(): void
30
    {
31
        $output = $this->runCommand('cache:clean');
32
        $this->assertStringContainsString('directory is missing', $output);
33
    }
34
35
    public function testCleanVerbose(): void
36
    {
37
        $this->runCommand('configure');
38
39
        $output = $this->runCommandDebug('cache:clean');
40
        $this->assertStringContainsString('i18n', $output);
41
    }
42
43
    public function testUpdateClean(): void
44
    {
45
        $out = $this->runCommand('update');
46
        $this->assertStringContainsString('Updating ORM schema', $out);
47
48
        $output = $this->runCommandDebug('cache:clean');
49
        $this->assertStringContainsString('cycle.php', $output);
50
    }
51
}
52