Exemple #1
0
 function testShell()
 {
     $Shell = new Shell();
     //
     // Delete tmp file
     //
     @unlink("/tmp/shelltest");
     $this->assertFalse(file_exists("/tmp/shelltest"), "Tmp file does not exists");
     //
     // Create tmp file
     //
     $Shell->Execute("touch", array("/tmp/shelltest"));
     $this->assertTrue(file_exists("/tmp/shelltest"), "Tmp file exists");
     //
     // ls -al
     //
     $result = $Shell->Query("ls", array("-al"));
     $this->assertTrue(!empty($result), "Result not empty");
     // Query raw
     $Shell->QueryRaw("ls -al");
     $this->assertTrue(!empty($result), "Result not empty");
 }