Added Tools\URL test case, and a test case superclass for initializing

Tools\URL
This commit is contained in:
franck
2013-09-06 01:55:16 +02:00
parent 07f0f34e5c
commit c8a5734a9e
6 changed files with 279 additions and 36 deletions

View File

@@ -37,7 +37,7 @@ use Thelia\Tools\URL;
*
* @package Thelia\Tests\Action\ImageTest
*/
class ImageTest extends \PHPUnit_Framework_TestCase
class ImageTest extends \Thelia\Tests\TestCaseWithURLToolSetup
{
protected $request;
@@ -49,27 +49,13 @@ class ImageTest extends \PHPUnit_Framework_TestCase
$dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
$url = new URL($container, 'dev');
$container->set("event_dispatcher", $dispatcher);
$container->set("thelia.url.manager", $dispatcher);
$request = new Request();
$request->setSession($this->session);
$container->set("request", $request);
$router = $this->getMock("Symfony\Component\Routing\Router");
$container->set("router.admin", $router);
$context = $this->getMock("Symfony\Component\Routing\RequestContext");
$context->setHost('localhost');
$context->setPort(80);
$context->setScheme('http');
$context->getBaseUrl('/tagada/tsointsoin/');
$router->setContext($context);
return $container;
}