예제 #1
0
 /**
  * Install the plugin into Moodle.
  *
  * @return string
  *
  * @throws \Exception
  */
 public function installPluginIntoMoodle()
 {
     $directory = $this->moodle->getComponentInstallDirectory($this->plugin->getComponent());
     if (is_dir($directory)) {
         throw new \RuntimeException('Plugin is already installed in standard Moodle');
     }
     $this->getOutput()->info(sprintf('Copying plugin from %s to %s', $this->plugin->directory, $directory));
     // Install the plugin.
     $filesystem = new Filesystem();
     $filesystem->mirror($this->plugin->directory, $directory);
     return $directory;
 }
예제 #2
0
 public function testGetBranch()
 {
     $moodle = new Moodle(__DIR__ . '/../Fixture/moodle');
     $this->assertEquals(29, $moodle->getBranch());
 }