Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
LimitExpressionTest.php
Go to the documentation of this file.
1 <?php
7 
8 class LimitExpressionTest extends \PHPUnit\Framework\TestCase
9 {
14  public function testToStringExceptionCount()
15  {
16  $sql = 'test sql';
17  $count = 0;
18  $model = new \Magento\Framework\DB\Sql\LimitExpression($sql, $count);
19  $model->__toString();
20  }
21 
26  public function testToStringExceptionOffset()
27  {
28  $sql = 'test sql';
29  $count = 1;
30  $offset = -1;
31  $model = new \Magento\Framework\DB\Sql\LimitExpression($sql, $count, $offset);
32  $model->__toString();
33  }
34 
35  public function testToString()
36  {
37  $sql = 'select * from test_table';
38  $count = 1;
39  $offset = 1;
40  $model = new \Magento\Framework\DB\Sql\LimitExpression($sql, $count, $offset);
41  $this->assertEquals('select * from test_table LIMIT 1 OFFSET 1', $model->__toString());
42  }
43 }
$count
Definition: recent.phtml:13