Exemplo n.º 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;
 }
Exemplo n.º 2
0
 public function testGetComponent()
 {
     $plugin = new MoodlePlugin($this->pluginDir);
     $this->assertEquals('local_travis', $plugin->getComponent());
 }
 protected function outputHeading(OutputInterface $output, $message)
 {
     $message = sprintf($message, $this->plugin->getComponent());
     $output->writeln(sprintf('<bg=green;fg=white;> RUN </> <fg=blue>%s</>', $message));
 }