fix unit tests search by id in loop bug

due to not visible first entry in database
This commit is contained in:
Etienne Roudeix
2013-11-14 14:17:47 +01:00
parent b2bb8791f9
commit 79120528b5
5 changed files with 25 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
namespace Thelia\Tests\Action;
use Propel\Runtime\ActiveQuery\Criteria;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
@@ -250,6 +251,10 @@ class OrderTest extends \PHPUnit_Framework_TestCase
throw new \Exception('No Payment Module fixture found');
}
/* define payment module in container */
$paymentModuleClass = $paymentModule->getFullNamespace();
$this->container->set(sprintf('module.%s', $paymentModule->getCode()), new $paymentModuleClass());
$this->orderEvent->getOrder()->chosenDeliveryAddress = $validDeliveryAddress->getId();
$this->orderEvent->getOrder()->chosenInvoiceAddress = $validInvoiceAddress->getId();
$this->orderEvent->getOrder()->setDeliveryModuleId($deliveryModule->getId());

View File

@@ -61,7 +61,11 @@ class CategoryTest extends BaseLoopTestor
$category->save();
}
$this->baseTestSearchById($category->getId());
$otherParameters = array(
"visible" => "*",
);
$this->baseTestSearchById($category->getId(), $otherParameters);
}
public function testSearchLimit()

View File

@@ -61,7 +61,11 @@ class ContentTest extends BaseLoopTestor
$content->save();
}
$this->baseTestSearchById($content->getId());
$otherParameters = array(
"visible" => "*",
);
$this->baseTestSearchById($content->getId(), $otherParameters);
}
public function testSearchLimit()

View File

@@ -61,7 +61,11 @@ class FolderTest extends BaseLoopTestor
$folder->save();
}
$this->baseTestSearchById($folder->getId());
$otherParameters = array(
"visible" => "*",
);
$this->baseTestSearchById($folder->getId(), $otherParameters);
}
public function testSearchLimit()

View File

@@ -62,7 +62,11 @@ class ProductTest extends BaseLoopTestor
$product->save();
}
$this->baseTestSearchById($product->getId());
$otherParameters = array(
"visible" => "*",
);
$this->baseTestSearchById($product->getId(), $otherParameters);
}
public function testSearchLimit()