Skip to content

Commit 2ed7939

Browse files
author
Can Demiralp
committed
[ECP-9489] Use Magento Select class instead of Zend DB
1 parent 9976d3e commit 2ed7939

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Test/Unit/Model/ResourceModel/Invoice/InvoiceTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@
1616
use Adyen\Payment\Test\Unit\AbstractAdyenTestCase;
1717
use Magento\Framework\App\ResourceConnection;
1818
use Magento\Framework\DB\Adapter\AdapterInterface;
19+
use Magento\Framework\DB\Select;
1920
use Magento\Framework\Exception\LocalizedException;
2021
use Magento\Framework\Model\ResourceModel\Db\Context;
2122
use PHPUnit\Framework\MockObject\MockObject;
22-
use Zend_Db_Select;
2323

2424
class InvoiceTest extends AbstractAdyenTestCase
2525
{
2626
private ?Invoice $invoiceResourceModel;
2727
private Context|MockObject $contextMock;
28-
private Zend_Db_Select|MockObject $zendSelectMock;
28+
private Select|MockObject $dbSelectMock;
2929
private AdapterInterface|MockObject $connectionMock;
3030

3131
/**
3232
* @return void
3333
*/
3434
protected function setUp(): void
3535
{
36-
$this->zendSelectMock = $this->createMock(Zend_Db_Select::class);
36+
$this->dbSelectMock = $this->createMock(Select::class);
3737

3838
$this->connectionMock = $this->createMock(AdapterInterface::class);
39-
$this->connectionMock->method('select')->willReturn($this->zendSelectMock);
39+
$this->connectionMock->method('select')->willReturn($this->dbSelectMock);
4040

4141
$resourceConnectionMock = $this->createMock(ResourceConnection::class);
4242
$resourceConnectionMock->method('getConnection')->willReturn($this->connectionMock);
@@ -65,15 +65,15 @@ public function testGetIdByPspreference()
6565
$pspreference = 'abc_123456789';
6666
$invoiceId = '1';
6767

68-
$this->zendSelectMock->method('from')
68+
$this->dbSelectMock->method('from')
6969
->with('adyen_invoice', InvoiceInterface::ENTITY_ID)
7070
->willReturnSelf();
71-
$this->zendSelectMock->method('where')
71+
$this->dbSelectMock->method('where')
7272
->with('pspreference = :pspreference')
7373
->willReturnSelf();
7474

7575
$this->connectionMock->method('fetchOne')
76-
->with($this->zendSelectMock, [':pspreference' => $pspreference])
76+
->with($this->dbSelectMock, [':pspreference' => $pspreference])
7777
->willReturn($invoiceId);
7878

7979
$result = $this->invoiceResourceModel->getIdByPspreference($pspreference);

0 commit comments

Comments
 (0)