test product loop limit
This commit is contained in:
@@ -129,6 +129,7 @@ abstract class BaseLoop
|
|||||||
$loopType = isset($nameValuePairs['type']) ? $nameValuePairs['type'] : "undefined";
|
$loopType = isset($nameValuePairs['type']) ? $nameValuePairs['type'] : "undefined";
|
||||||
$loopName = isset($nameValuePairs['name']) ? $nameValuePairs['name'] : "undefined";
|
$loopName = isset($nameValuePairs['name']) ? $nameValuePairs['name'] : "undefined";
|
||||||
|
|
||||||
|
$this->args->rewind();
|
||||||
while (($argument = $this->args->current()) !== false) {
|
while (($argument = $this->args->current()) !== false) {
|
||||||
$this->args->next();
|
$this->args->next();
|
||||||
|
|
||||||
|
|||||||
@@ -54,13 +54,17 @@ class ProductTest extends BaseLoopTestor
|
|||||||
{
|
{
|
||||||
$product = ProductQuery::create()->findOne();
|
$product = ProductQuery::create()->findOne();
|
||||||
|
|
||||||
$loop = new Product($this->container);
|
$this->instance->initializeArgs(array_merge(
|
||||||
$loop->initializeArgs(array(
|
$this->getMandatoryArguments(),
|
||||||
"type" => "product",
|
array(
|
||||||
"name" => "product",
|
"type" => "product",
|
||||||
"id" => $product->getId(),
|
"name" => "product",
|
||||||
|
"id" => $product->getId(),
|
||||||
|
)
|
||||||
));
|
));
|
||||||
$loopResults = $loop->exec($pagination);
|
|
||||||
|
$dummy = null;
|
||||||
|
$loopResults = $this->instance->exec($dummy);
|
||||||
|
|
||||||
$this->assertEquals(1, $loopResults->getCount());
|
$this->assertEquals(1, $loopResults->getCount());
|
||||||
|
|
||||||
@@ -68,4 +72,18 @@ class ProductTest extends BaseLoopTestor
|
|||||||
|
|
||||||
$this->assertEquals($product->getId(), $substitutions['ID']);
|
$this->assertEquals($product->getId(), $substitutions['ID']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSearchLimit()
|
||||||
|
{
|
||||||
|
$this->instance->initializeArgs(array(
|
||||||
|
"type" => "product",
|
||||||
|
"name" => "product",
|
||||||
|
"limit" => 3,
|
||||||
|
));
|
||||||
|
|
||||||
|
$dummy = null;
|
||||||
|
$loopResults = $this->instance->exec($dummy);
|
||||||
|
|
||||||
|
$this->assertEquals(3, $loopResults->getCount());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user