. */ /* */ /*************************************************************************************/ namespace Thelia\Tests; /** * This class provides URL Tool class initialisation * * @package Thelia\Tests\TestCaseWithURLSetup */ class TestCaseWithURLToolSetup extends \PHPUnit_Framework_TestCase { public function __construct() { $this->setupURLTool(); } protected function setupURLTool() { $container = new \Symfony\Component\DependencyInjection\ContainerBuilder(); $context = new \Symfony\Component\Routing\RequestContext( '/thelia/index.php', 'GET', 'localhost', 'http', 80, 443, '/path/to/action' ); $router = $this->getMockBuilder("Symfony\Component\Routing\Router") ->disableOriginalConstructor() ->getMock(); $router->expects($this->any()) ->method('getContext') ->will($this->returnValue($context)); $container->set("router.admin", $router); new \Thelia\Tools\URL($container); } }