/** * @return void */ public function testFilterLastItem() { $this->collectionMock->expects($this->once())->method('addOrder')->with('created_at', \Magento\Framework\Data\Collection::SORT_ORDER_DESC)->willReturnSelf(); $this->selectMock->expects($this->once())->method('limit')->willReturnSelf(); $this->assertEquals($this->collectionMock, $this->collectionMock->filterLastItem()); }
/** * filterLastItem() test * * @magentoDataFixture Magento/Security/_files/password_reset_request_events.php */ public function testFilterLastItem() { $this->collectionModel->filterLastItem()->load(); $this->assertEquals('2016-01-20 13:00:13', $this->collectionModel->getFirstItem()->getData('created_at')); }