for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
* @copyright Aimeos (aimeos.org), 2021
*/
namespace Aimeos\Controller\Frontend\Site;
class FactoryTest extends \PHPUnit\Framework\TestCase
{
public function testCreateController()
$target = '\\Aimeos\\Controller\\Frontend\\Site\\Iface';
$controller = \Aimeos\Controller\Frontend\Site\Factory::create( \TestHelperFrontend::getContext() );
$this->assertInstanceOf( $target, $controller );
$controller = \Aimeos\Controller\Frontend\Site\Factory::create( \TestHelperFrontend::getContext(), 'Standard' );
}
public function testCreateControllerInvalidImplementation()
$this->expectException( '\\Aimeos\\MW\\Common\\Exception' );
\Aimeos\Controller\Frontend\Site\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' );
public function testCreateControllerInvalidName()
$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
\Aimeos\Controller\Frontend\Site\Factory::create( \TestHelperFrontend::getContext(), '%^' );
public function testCreateControllerNotExisting()
\Aimeos\Controller\Frontend\Site\Factory::create( \TestHelperFrontend::getContext(), 'notexist' );