Esempio n. 1
0
 private function formatErroneousPlugin(InputInterface $input, Plugin $plugin)
 {
     if ($input->getOption('json')) {
         return ['name' => $plugin->getName(), 'error' => true, 'description' => 'Error : ' . $plugin->getError()->getMessage(), 'version' => null];
     }
     return ['<error>' . $plugin->getName() . '</error>', '<error>Error : ' . $plugin->getError()->getMessage() . '</error>', ''];
 }
Esempio n. 2
0
 public function testGetters()
 {
     $manifest = $this->createManifestMock();
     $error = $this->getMock('Alchemy\\Phrasea\\Plugin\\Exception\\PluginValidationException');
     $plugin = new Plugin('toto', $manifest, null);
     $this->assertSame('toto', $plugin->getName());
     $this->assertSame($manifest, $plugin->getManifest());
     $this->assertNull($plugin->getError());
     $this->assertFalse($plugin->isErroneous());
     $plugin = new Plugin('toto', null, $error);
     $this->assertSame('toto', $plugin->getName());
     $this->assertNull($plugin->getManifest());
     $this->assertSame($error, $plugin->getError());
     $this->assertTrue($plugin->isErroneous());
 }