6 * Filesystem related testing.
10 class FilesystemCase extends CommandUnishTestCase {
12 public function testSbit() {
13 if ($this->is_windows()) {
14 $this->markTestSkipped("s-bit test doesn't apply on Windows.");
16 if (UNISH_USERGROUP === NULL) {
17 $this->markTestSkipped("s-bit test skipped because of UNISH_USERGROUP was not set.");
20 $dest = UNISH_SANDBOX . '/test-filesystem-sbit';
22 chgrp($dest, UNISH_USERGROUP);
23 chmod($dest, 02755); // rwxr-sr-x
25 $this->drush('pm-download', array('devel'), array('cache' => NULL, 'skip' => NULL, 'destination' => $dest));
27 $group = posix_getgrgid(filegroup($dest . '/devel/README.txt'));
28 $this->assertEquals($group['name'], UNISH_USERGROUP, 'Group is preserved.');
30 $perms = fileperms($dest . '/devel') & 02000;
31 $this->assertEquals($perms, 02000, 's-bit is preserved.');
34 public function testExecuteBits() {
35 if ($this->is_windows()) {
36 $this->markTestSkipped("execute bit test doesn't apply on Windows.");
39 $dest = UNISH_SANDBOX . '/test-filesystem-execute';
41 $this->execute(sprintf("git clone --depth=1 https://github.com/drush-ops/drush.git %s", $dest . '/drush'));
43 $perms = fileperms($dest . '/drush/drush') & 0111;
44 $this->assertEquals($perms, 0111, 'Execute permission is preserved.');