This commit is contained in:
Franck Allimant
2013-11-06 11:16:46 +01:00
12 changed files with 62 additions and 7 deletions

View File

@@ -410,6 +410,11 @@ abstract class BaseLoop
}
}
/**
* @param LoopResult $loopResult
*
* @return LoopResult
*/
abstract public function parseResults(LoopResult $loopResult);
/**

View File

@@ -53,6 +53,13 @@ class CategoryTest extends BaseLoopTestor
public function testSearchById()
{
$category = CategoryQuery::create()->findOne();
if(null === $category) {
$category = new \Thelia\Model\Category();
$category->setParent(0);
$category->setVisible(1);
$category->setTitle('foo');
$category->save();
}
$this->baseTestSearchById($category->getId());
}

View File

@@ -53,6 +53,13 @@ class ContentTest extends BaseLoopTestor
public function testSearchById()
{
$content = ContentQuery::create()->findOne();
if(null === $content) {
$content = new \Thelia\Model\Content();
$content->setDefaultFolder(0);
$content->setVisible(1);
$content->setTitle('foo');
$content->save();
}
$this->baseTestSearchById($content->getId());
}

View File

@@ -53,6 +53,13 @@ class FolderTest extends BaseLoopTestor
public function testSearchById()
{
$folder = FolderQuery::create()->findOne();
if(null === $folder) {
$folder = new \Thelia\Model\Folder();
$folder->setParent(0);
$folder->setVisible(1);
$folder->setTitle('foo');
$folder->save();
}
$this->baseTestSearchById($folder->getId());
}

View File

@@ -54,6 +54,13 @@ class ProductTest extends BaseLoopTestor
public function testSearchById()
{
$product = ProductQuery::create()->orderById(Criteria::ASC)->findOne();
if(null === $product) {
$product = new \Thelia\Model\Product();
$product->setDefaultCategory(0);
$product->setVisible(1);
$product->setTitle('foo');
$product->save();
}
$this->baseTestSearchById($product->getId());
}

View File

@@ -53,6 +53,11 @@ class TaxRuleTest extends BaseLoopTestor
public function testSearchById()
{
$tr = TaxRuleQuery::create()->findOne();
if(null === $tr) {
$tr = new \Thelia\Model\TaxRule();
$tr->setTitle('foo');
$tr->save();
}
$this->baseTestSearchById($tr->getId(), array('force_return' => true));
}