fix fixture dependant unit test
This commit is contained in:
@@ -189,7 +189,7 @@ try {
|
|||||||
$featureList = array();
|
$featureList = array();
|
||||||
for($i=0; $i<4; $i++) {
|
for($i=0; $i<4; $i++) {
|
||||||
$feature = new Thelia\Model\Feature();
|
$feature = new Thelia\Model\Feature();
|
||||||
$feature->setVisible(rand(1, 10)>7 ? 0 : 1);
|
$feature->setVisible(1);
|
||||||
$feature->setPosition($i);
|
$feature->setPosition($i);
|
||||||
setI18n($faker, $feature);
|
setI18n($faker, $feature);
|
||||||
|
|
||||||
@@ -257,7 +257,7 @@ try {
|
|||||||
for($i=0; $i<4; $i++) {
|
for($i=0; $i<4; $i++) {
|
||||||
$folder = new Thelia\Model\Folder();
|
$folder = new Thelia\Model\Folder();
|
||||||
$folder->setParent(0);
|
$folder->setParent(0);
|
||||||
$folder->setVisible(rand(1, 10)>7 ? 0 : 1);
|
$folder->setVisible(1);
|
||||||
$folder->setPosition($i);
|
$folder->setPosition($i);
|
||||||
setI18n($faker, $folder);
|
setI18n($faker, $folder);
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ try {
|
|||||||
for($j=1; $j<rand(0, 5); $j++) {
|
for($j=1; $j<rand(0, 5); $j++) {
|
||||||
$subfolder = new Thelia\Model\Folder();
|
$subfolder = new Thelia\Model\Folder();
|
||||||
$subfolder->setParent($folder->getId());
|
$subfolder->setParent($folder->getId());
|
||||||
$subfolder->setVisible(rand(1, 10)>7 ? 0 : 1);
|
$subfolder->setVisible(1);
|
||||||
$subfolder->setPosition($j);
|
$subfolder->setPosition($j);
|
||||||
setI18n($faker, $subfolder);
|
setI18n($faker, $subfolder);
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ try {
|
|||||||
for($k=0; $k<rand(0, 5); $k++) {
|
for($k=0; $k<rand(0, 5); $k++) {
|
||||||
$content = new Thelia\Model\Content();
|
$content = new Thelia\Model\Content();
|
||||||
$content->addFolder($subfolder);
|
$content->addFolder($subfolder);
|
||||||
$content->setVisible(rand(1, 10)>7 ? 0 : 1);
|
$content->setVisible(1);
|
||||||
$content->setPosition($k);
|
$content->setPosition($k);
|
||||||
setI18n($faker, $content);
|
setI18n($faker, $content);
|
||||||
|
|
||||||
@@ -418,7 +418,7 @@ function createProduct($faker, $category, $position, $template, &$productIdList)
|
|||||||
$product = new Thelia\Model\Product();
|
$product = new Thelia\Model\Product();
|
||||||
$product->setRef($category->getId() . '_' . $position . '_' . $faker->randomNumber(8));
|
$product->setRef($category->getId() . '_' . $position . '_' . $faker->randomNumber(8));
|
||||||
$product->addCategory($category);
|
$product->addCategory($category);
|
||||||
$product->setVisible(rand(1, 10)>7 ? 0 : 1);
|
$product->setVisible(1);
|
||||||
$product->setPosition($position);
|
$product->setPosition($position);
|
||||||
$product->setTaxRuleId(1);
|
$product->setTaxRuleId(1);
|
||||||
$product->setTemplate($template);
|
$product->setTemplate($template);
|
||||||
@@ -440,7 +440,7 @@ function createCategory($faker, $parent, $position, &$categoryIdList, $contentId
|
|||||||
{
|
{
|
||||||
$category = new Thelia\Model\Category();
|
$category = new Thelia\Model\Category();
|
||||||
$category->setParent($parent);
|
$category->setParent($parent);
|
||||||
$category->setVisible(rand(1, 10)>7 ? 0 : 1);
|
$category->setVisible(1);
|
||||||
$category->setPosition($position);
|
$category->setPosition($position);
|
||||||
setI18n($faker, $category);
|
setI18n($faker, $category);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user