mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Plugin;
|
|
|
|
use Alchemy\Phrasea\Plugin\Plugin;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class PluginTest extends PluginTestCase
|
|
{
|
|
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());
|
|
}
|
|
|
|
/**
|
|
* @expectedException \LogicException
|
|
*/
|
|
public function testBothNull()
|
|
{
|
|
new Plugin('toto', null, null);
|
|
}
|
|
|
|
/**
|
|
* @expectedException \LogicException
|
|
*/
|
|
public function testBothNotNull()
|
|
{
|
|
$manifest = $this->createManifestMock();
|
|
$error = $this->getMock('Alchemy\Phrasea\Plugin\Exception\PluginValidationException');
|
|
|
|
new Plugin('toto', $manifest, $error);
|
|
}
|
|
}
|