for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* MtMail - e-mail module for Zend Framework
*
* @link http://github.com/mtymek/MtMail
* @copyright Copyright (c) 2013-2017 Mateusz Tymek
* @license BSD 2-Clause
*/
namespace MtMailTest\Service;
use MtMail\Exception\RuntimeException;
use MtMail\SenderPlugin\PluginInterface;
use MtMail\Service\SenderPluginManager;
use PHPUnit\Framework\TestCase;
use stdClass;
use Zend\ServiceManager\ServiceManager;
class SenderPluginManagerTest extends TestCase
{
* @var SenderPluginManager
protected $pluginManager;
public function setUp()
$this->pluginManager = new SenderPluginManager(new ServiceManager());
}
* @expectedException RuntimeException
public function testValidatePluginThrowsExceptionIfPluginIsInvalid()
$this->pluginManager->validatePlugin(new stdClass());
public function testValidatePluginDoesNothingIfPluginIsValid()
$mock = $this->prophesize(PluginInterface::class);
$this->pluginManager->validatePlugin($mock->reveal());
$this->assertTrue(true);
public function testValidateThrowsExceptionIfPluginIsInvalid()
$this->pluginManager->validate(new stdClass());
public function testValidateDoesNothingIfPluginIsValid()
$this->pluginManager->validate($mock->reveal());