File: HasFreeSpaceConditionTest.php

package info (click to toggle)
phing 3.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,328 kB
  • sloc: php: 59,826; xml: 9,770; sql: 78; makefile: 39; sh: 14
file content (40 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

namespace Phing\Task\System\Condition;

use Phing\Test\Support\BuildFileTest;

class HasFreeSpaceConditionTest extends BuildFileTest
{
    public function setUp(): void
    {
        $this->configureProject(PHING_TEST_BASE . '/etc/tasks/system/HasFreeSpaceConditionTest.xml');
    }

    public function testPartitionNotSet()
    {
        $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'Please set the partition attribute.');
    }

    public function testNeededNotSet()
    {
        $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'Please set the needed attribute.');
    }

    public function testInvalidPartition()
    {
        $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'disk_free_space(): No such file or directory');
    }

    public function testEnoughSpace()
    {
        $this->executeTarget(__FUNCTION__);
        $this->assertInLogs('HasFreeSpaceConditionTest: Enough space in disk.');
    }

    public function testNotEnoughSpace()
    {
        $this->executeTarget(__FUNCTION__);
        $this->assertInLogs('HasFreeSpaceConditionTest: Not enough space in disk.');
    }
}