![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/framework/Data/Test/Unit/Collection/Db/FetchStrategy/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\Data\Test\Unit\Collection\Db\FetchStrategy; use Magento\Framework\Data\Collection\Db\FetchStrategy\Query; use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Select; use Magento\Framework\DB\Select\SelectRenderer; use PHPUnit\Framework\TestCase; class QueryTest extends TestCase { public function testFetchAll() { $expectedResult = new \stdClass(); $bindParams = ['param_one' => 'value_one', 'param_two' => 'value_two']; $adapter = $this->createPartialMock(Mysql::class, ['fetchAll']); $renderer = $this->createMock(SelectRenderer::class); $select = new Select($adapter, $renderer); $adapter->expects( $this->once() )->method( 'fetchAll' )->with( $select, $bindParams )->willReturn( $expectedResult ); $object = new Query(); $this->assertSame($expectedResult, $object->fetchAll($select, $bindParams)); } }