30 $this->connectionMock = $this->createMock(\
Magento\Framework\DB\Adapter\Pdo\Mysql::class);
32 $this->resourceMock = $this->createMock(\
Magento\Framework\
App\ResourceConnection::class);
33 $this->resourceMock->expects($this->any())->method(
'getConnection')->willReturn($this->connectionMock);
36 $contextMock->expects($this->once())->method(
'getResources')->willReturn($this->resourceMock);
38 $this->nonceResource = new \Magento\Integration\Model\ResourceModel\Oauth\Nonce($contextMock);
43 $this->connectionMock->expects($this->once())->method(
'delete');
44 $this->connectionMock->expects($this->once())->method(
'quoteInto');
45 $this->nonceResource->deleteOldEntries(5);
50 $selectMock = $this->createMock(\
Magento\Framework\DB\Select::class);
51 $selectMock->expects($this->once())->method(
'from')->will($this->returnValue($selectMock));
52 $selectMock->expects($this->exactly(2))->method(
'where')->will($this->returnValue($selectMock));
53 $this->connectionMock->expects($this->once())->method(
'select')->willReturn($selectMock);
54 $this->connectionMock->expects($this->once())->method(
'fetchRow');
55 $this->nonceResource->selectByCompositeKey(
'nonce', 5);
testSelectByCompositeKey()