mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-08-28 18:18:57 +02:00
[fs/chmod] Allow to not use flags
This commit is contained in:
@@ -48,6 +48,36 @@ class ChangeModeTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testChangeModeTaskWithoutFlags()
|
||||
{
|
||||
$runtime = new RuntimeMockup();
|
||||
$runtime->setConfiguration(['environments' => ['test' => []]]);
|
||||
$runtime->setEnvironment('test');
|
||||
|
||||
$task = new ChangeModeTask();
|
||||
$task->setOptions(['file' => 'a.txt', 'mode' => 'o+w']);
|
||||
$task->setRuntime($runtime);
|
||||
|
||||
$this->assertContains('a.txt', $task->getDescription());
|
||||
$this->assertNotContains('-R', $task->getDescription());
|
||||
$this->assertContains('o+w', $task->getDescription());
|
||||
$task->execute();
|
||||
|
||||
$ranCommands = $runtime->getRanCommands();
|
||||
|
||||
$testCase = array(
|
||||
0 => 'chmod o+w a.txt',
|
||||
);
|
||||
|
||||
// Check total of Executed Commands
|
||||
$this->assertEquals(count($testCase), count($ranCommands));
|
||||
|
||||
// Check Generated Commands
|
||||
foreach ($testCase as $index => $command) {
|
||||
$this->assertEquals($command, $ranCommands[$index]);
|
||||
}
|
||||
}
|
||||
|
||||
public function testChangeModeReplaceTask()
|
||||
{
|
||||
$runtime = new RuntimeMockup();
|
||||
|
||||
Reference in New Issue
Block a user