fix tests

This commit is contained in:
Etienne Roudeix
2013-12-09 15:31:27 +01:00
parent 28d2add37d
commit 95d327f976
4 changed files with 56 additions and 49 deletions

View File

@@ -30,15 +30,21 @@ namespace Thelia\Tests;
*/
class TestCaseWithURLToolSetup extends \PHPUnit_Framework_TestCase
{
private $container = null;
public function __construct()
{
$this->container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
$dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
$this->container->set("event_dispatcher", $dispatcher);
$this->setupURLTool();
}
protected function setupURLTool()
{
$container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
$context = new \Symfony\Component\Routing\RequestContext(
'/thelia/index.php',
'GET',
@@ -57,8 +63,13 @@ class TestCaseWithURLToolSetup extends \PHPUnit_Framework_TestCase
->method('getContext')
->will($this->returnValue($context));
$container->set("router.admin", $router);
$this->container->set("router.admin", $router);
new \Thelia\Tools\URL($container);
new \Thelia\Tools\URL($this->container);
}
public function getContainer()
{
return $this->container;
}
}