示例#1
0
 public function test_set_executable()
 {
     if (strncasecmp(PHP_OS, 'WIN', 3) === 0) {
         $this->markTestSkipped('This functionality is not working on Windows.');
     }
     if (posix_geteuid() === 0) {
         $this->markTestSkipped('These tests don\'t work when run as root');
     }
     $this->assertFalse(util::set_executable('/no/such/file'));
     $dirname = dirname(__FILE__);
     $file = $dirname . '/test9';
     touch($file);
     $this->assertFalse(is_executable($file));
     util::set_executable($file, true);
     clearstatcache();
     $this->assertTrue(is_executable($file));
     util::set_executable($file, false);
     clearstatcache();
     $this->assertFalse(is_executable($file));
     unlink($file);
 }