Passed
Push — main ( 58ef3e...be0a65 )
by Michiel
07:16
created

HasFreeSpaceConditionTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Phing\Task\System\Condition;
4
5
use Phing\Test\Support\BuildFileTest;
6
7
class HasFreeSpaceConditionTest extends BuildFileTest
8
{
9
    public function setUp(): void
10
    {
11
        $this->configureProject(PHING_TEST_BASE . '/etc/tasks/system/HasFreeSpaceConditionTest.xml');
12
    }
13
14
    public function testPartitionNotSet()
15
    {
16
        $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'Please set the partition attribute.');
17
    }
18
19
    public function testNeededNotSet()
20
    {
21
        $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'Please set the needed attribute.');
22
    }
23
24
    public function testInvalidPartition()
25
    {
26
        $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'disk_free_space(): No such file or directory');
27
    }
28
29
    public function testEnoughSpace()
30
    {
31
        $this->executeTarget(__FUNCTION__);
32
        $this->assertInLogs('HasFreeSpaceConditionTest: Enough space in disk.');
33
    }
34
35
    public function testNotEnoughSpace()
36
    {
37
        $this->executeTarget(__FUNCTION__);
38
        $this->assertInLogs('HasFreeSpaceConditionTest: Not enough space in disk.');
39
    }
40
}
41