for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* MtMail - e-mail module for Zend Framework 2
*
* @link http://github.com/mtymek/MtMail
* @copyright Copyright (c) 2013-2014 Mateusz Tymek
* @license BSD 2-Clause
*/
namespace MtMailTest\Template;
use MtMail\Exception\RuntimeException;
use MtMail\Service\TemplateManager;
use Zend\ServiceManager\ServiceManager;
class ManagerTest extends \PHPUnit_Framework_TestCase
{
* @var TemplateManager
protected $manager;
public function setUp()
$this->manager = new TemplateManager(new ServiceManager());
}
* @expectedException RuntimeException
public function testValidatePluginThrowsExceptionWhenClassIsInvalid()
$this->manager->validatePlugin(new \stdClass());
public function testValidatePluginDoesNothingIfPluginIsValid()
$mock = $this->getMock('MtMail\Template\TemplateInterface');
$this->manager->validatePlugin($mock);
public function testValidateThrowsExceptionWhenClassIsInvalid()
$this->manager->validate(new \stdClass());
public function testValidateDoesNothingIfPluginIsValid()
$this->manager->validate($mock);