Skip to content

Commit

Permalink
Fix for issue magento#21510
Browse files Browse the repository at this point in the history
  • Loading branch information
ccasciotti committed Mar 5, 2019
1 parent 0982a53 commit 2c956f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Indexer/Model/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public function getLatestUpdated()
return $this->getView()->getUpdated();
}
}
return $this->getState()->getUpdated();
return $this->getState()->getUpdated() ?: '';
}

/**
Expand Down
10 changes: 8 additions & 2 deletions app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ public function testGetLatestUpdated($getViewIsEnabled, $getViewGetUpdated, $get
}
}
} else {
$this->assertEquals($getStateGetUpdated, $this->model->getLatestUpdated());
$actualGetLatestUpdated = $this->model->getLatestUpdated();
$this->assertEquals($getStateGetUpdated, $actualGetLatestUpdated);

if ($getStateGetUpdated === null) {
$this->assertNotNull($actualGetLatestUpdated);
}
}
}

Expand All @@ -182,7 +187,8 @@ public function getLatestUpdatedDataProvider()
[true, '', '06-Jan-1944'],
[true, '06-Jan-1944', ''],
[true, '', ''],
[true, '06-Jan-1944', '05-Jan-1944']
[true, '06-Jan-1944', '05-Jan-1944'],
[false, null, null],
];
}

Expand Down

0 comments on commit 2c956f6

Please sign in to comment.