fix unit tests search by id in loop bug
due to not visible first entry in database
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user