38 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
40 $this->createPartialMock(\
Magento\Framework\DB\Platform\Quote::class, [
'quoteTableAs',
'quoteIdentifier']);
41 $this->selectMock = $this->createPartialMock(\
Magento\Framework\DB\Select::class, [
'getPart']);
44 [
'quote' => $this->quoteMock]
51 $this->selectMock->expects($this->once())
55 $this->assertEquals($sql, $this->model->render($this->selectMock, $sql));
66 $this->quoteMock->expects($this->any())
67 ->method(
'quoteIdentifier')
68 ->willReturnArgument(0);
69 $this->quoteMock->expects($this->any())
70 ->method(
'quoteTableAs')
76 $this->selectMock->expects($this->once())
80 $this->assertEquals($expectedResult, $this->model->render($this->selectMock, $sql));
91 [[
'joinType' =>
Select::FROM,
'schema' =>
null,
'tableName' =>
't1',
'joinCondition' =>
null]],
93 'SELECT * FROM t1 AS 0' 97 'a' => [
'joinType' =>
Select::FROM,
'schema' =>
null,
'tableName' =>
't1',
'joinCondition' =>
null],
98 'b' => [
'joinType' =>
Select::FROM,
'schema' =>
null,
'tableName' =>
't2',
'joinCondition' =>
null]
101 'SELECT a.* FROM t1 AS a' .
"\n" .
' INNER JOIN t2 AS b' 105 'a' => [
'joinType' =>
Select::FROM,
'schema' =>
null,
'tableName' =>
't1',
'joinCondition' =>
null],
110 'joinCondition' =>
't1.f1 = t2.f2' 114 'SELECT b.f2 FROM t1 AS a' .
"\n" .
' LEFT JOIN db.t2 AS b ON t1.f1 = t2.f2'
testRender($from, $sql, $expectedResult)