isRoot() public static method

Check is current user ROOT
public static isRoot ( ) : boolean
return boolean
Beispiel #1
0
 public function testExecutable()
 {
     if (Sys::isWin()) {
         //skip('This functionality is not working on Windows.');
         return false;
     }
     if (Sys::isRoot()) {
         skip('These tests don\'t work when run as root');
     }
     isFalse(FS::executable('/no/such/file'));
     $dirname = dirname(__FILE__);
     $file = $dirname . '/test9';
     touch($file);
     isFalse(is_executable($file));
     FS::executable($file, true);
     clearstatcache();
     isTrue(is_executable($file));
     FS::executable($file, false);
     clearstatcache();
     isFalse(is_executable($file));
     unlink($file);
 }