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.');
}
}
|