Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/code/Magento/Analytics/ReportXml/DB/ReportValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Magento\Framework\Api\SearchCriteriaInterface;

/**
* Validates report definitions by doing query to storage with limit 0
* Validates report definitions by doing query to storage with limit 1
*/
class ReportValidator
{
Expand Down Expand Up @@ -39,7 +39,7 @@ public function __construct(ConnectionFactory $connectionFactory, QueryFactory $
}

/**
* Tries to do query for provided report with limit 0 and return error information if it failed
* Tries to do query for provided report with limit 1 and return error information if it failed
*
* @param string $name
* @param SearchCriteriaInterface $criteria
Expand All @@ -50,7 +50,7 @@ public function validate($name, ?SearchCriteriaInterface $criteria = null)
{
$query = $this->queryFactory->create($name);
$connection = $this->connectionFactory->getConnection($query->getConnectionName());
$query->getSelect()->limit(0);
$query->getSelect()->limit(1);
try {
$connection->query($query->getSelect());
} catch (\Zend_Db_Statement_Exception $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function testValidate($reportName, $result, $stubType, $stubValue = null)
->with($connectionName)
->willReturn($this->connectionMock);
$this->queryMock->expects($this->atLeastOnce())->method('getSelect')->willReturn($this->selectMock);
$this->selectMock->expects($this->once())->method('limit')->with(0);
$this->selectMock->expects($this->once())->method('limit')->with(1);

// Configure query mock based on stub type
if ($stubType === 'returnValue') {
Expand Down