Completed
Pull Request — master (#924)
by Greg
02:29
created

CleanDirTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 30
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A tearDown() 0 4 1
A testCleanDir() 0 10 1
1
<?php
2
namespace Robo;
3
4
use PHPUnit\Framework\TestCase;
5
use Robo\Traits\TestTasksTrait;
6
7
class CleanDirTest extends TestCase
8
{
9
    use TestTasksTrait;
10
    use Task\Filesystem\loadTasks;
11
12
    protected $fixtures;
13
14
    public function setUp()
15
    {
16
        $this->fixtures = new Fixtures();
17
        $this->initTestTasksTrait();
18
    }
19
20
    public function tearDown()
21
    {
22
        $this->fixtures->cleanup();
23
    }
24
25
    public function testCleanDir()
26
    {
27
        $this->fixtures->createAndCdToSandbox();
28
29
        $this->assertFileExists('box/robo.txt');
30
        $this->taskCleanDir(['box'])
31
            ->run();
32
        $this->assertFileNotExists('box/robo.txt');
33
        $this->assertFileExists('a.txt');
34
    }
35
36
}
37