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