/**
  * Test append
  *
  * @return null
  */
 public function testAppend()
 {
     $path = $this->files->tempnam();
     $htaccess = new Htaccess($path);
     $denyFromAll = "Deny from all";
     $htaccess->append($denyFromAll);
     $this->assertEquals($denyFromAll . PHP_EOL, $htaccess->getContents());
     $htaccess->append($denyFromAll);
     $this->assertEquals($denyFromAll . PHP_EOL, $htaccess->getContents());
 }
Example #2
0
 protected function setUp()
 {
     if (is_null($this->_files)) {
         $this->_files = new Files();
     }
     $dir = $this->_files->mkdir();
     $data = array("key1" => 1, "key2" => 3);
     file_put_contents($dir . "/test_config1.serialized", serialize($data));
     $dataAdapter = new Adapter_Serialized($dir);
     Config::setDataAdapter($dataAdapter);
 }
 /**
  * Sets up the fixture
  *
  * @return null
  */
 protected function setUp()
 {
     $this->files = new Files();
     $this->composer = new Composer();
     $this->config = new Config();
     $this->composer->setConfig($this->config);
     $this->vendorDir = realpath($this->files->mkdir());
     $this->binDir = realpath($this->files->mkdir());
     $this->moodleDir = realpath($this->files->mkdir()) . "/www";
     $this->config->merge(array('config' => array('vendor-dir' => $this->vendorDir, 'bin-dir' => $this->binDir, 'moodle-dir' => $this->moodleDir, 'home' => $this->files->mkdir())));
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
 }