Exemplo n.º 1
0
 public function testPhingInstallation()
 {
     $tmpDir = sys_get_temp_dir();
     WadeLib::installPhingManually($tmpDir, $tmpDir . '/phing');
     # Start Phing with a test-buildfile
     $phingDir = $tmpDir . '/phing';
     $phingInclude = $phingDir . '/classes/';
     ini_set('include_path', $phingInclude);
     require $phingInclude . 'phing/Phing.php';
     Phing::startup();
     # Sets up the phing environment
     Phing::start(array('-buildfile', 'tests/build.xml'));
     # Check results of test-buildfile
     $resultFile = __DIR__ . '/wadelib_testbuild';
     $this->assertEquals(PHP_OS, file_get_contents($resultFile));
     # Delete local files:
     unlink($resultFile);
     # Remove extracted Phing library:
     FileSystemManager::rrmdir($phingDir);
 }
Exemplo n.º 2
0
 /**
  * Function: installPhingManually
  *
  * Install Phing by downloading the Zip-Archive
  * and extracting it.
  */
 public static function installPhingManually($downloadDirectory, $installationDirectory)
 {
     # Download file:
     WadeLib::downloadFile('http://www.phing.info/get/phing-2.4.12.zip', $downloadDirectory);
     # Extract Phing:
     WadeLib::extractZipfile($downloadDirectory . '/phing-2.4.12.zip', $installationDirectory);
 }