Permalink
Browse files

Merge pull request #12 from pulse00/tests

added base testcase class
  • Loading branch information...
2 parents 921eec9 + e2f00dc commit 9fc24f879afcab71e43b8cacce73f93bf7f52a01 @lsmith77 lsmith77 committed Dec 18, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 Test/MagentoTestCase.php
View
@@ -0,0 +1,23 @@
+<?php
+
+namespace Liip\MagentoBundle\Test;
+use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
+
+class MagentoTestCase extends WebTestCase
+{
+ static protected function createClient(array $options = array(), array $server = array())
+ {
+ // let the parent create the client
+ $client = parent::createClient($options, $server);
+
+ // load the magefile, create the mage app and dispatch the
+ // symfony_on_kernel_request event so the mage-container is properly initialized
+ require_once static::$kernel->getContainer()
+ ->getParameter('liip_magento.mage_file');
+
+ $params = array('container' => self::$kernel->getContainer());
+ \Mage::app()->dispatchEvent('symfony_on_kernel_request', $params);
+ return $client;
+
+ }
+}

0 comments on commit 9fc24f8

Please sign in to comment.