Permalink
Browse files

fix EcomDev_PHPUnit_Test_Case::setUp for error 'Cannot run controller…

… test, because the host is not set for base url.' for tests based on EcomDev_PHPUnit_Test_Case that uses singleton customer/session. ex: helper test for Product::getFinalPrice
  • Loading branch information...
1 parent 9dbb8ca commit 61cefb219d7cc6db2247400c68dfdc37257d7484 @pablobender committed Mar 8, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 app/code/community/EcomDev/PHPUnit/Test/Case.php
View
13 app/code/community/EcomDev/PHPUnit/Test/Case.php
@@ -718,4 +718,17 @@ public function __call($method, array $args)
{
return TestUtil::call($method, $args);
}
+
+ /**
+ * Set up controller params
+ * (non-PHPdoc)
+ * @see PHPUnit_Framework_TestCase::setUp()
+ */
+ protected function setUp()
+ {
+ parent::setUp();
+ $_SESSION = array();
+ $_baseUrl = Mage::getStoreConfig('web/unsecure/base_url');
+ $this->app()->getRequest()->setBaseUrl($_baseUrl);
+ }
}

0 comments on commit 61cefb2

Please sign in to comment.