Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UnionExpressionTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class UnionExpressionTest extends \PHPUnit\Framework\TestCase
11 {
12  public function testToString()
13  {
14  $sqlMock = $this->getMockBuilder(\Magento\Framework\DB\Select::class)
15  ->disableOriginalConstructor()
16  ->getMock();
17  $sqlMock->expects($this->once())
18  ->method('assemble')
19  ->willReturn('test_assemble');
20  $parts = [
21  $sqlMock,
22  '(test_column)'
23  ];
24  $model = new \Magento\Framework\DB\Sql\UnionExpression($parts);
25  $this->assertEquals('(test_assemble)' . Select::SQL_UNION . '(test_column)', $model->__toString());
26  }
27 }
const SQL_UNION
Definition: Select.php:68