%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/phpmyadmin/sql-parser/tests/Builder/ |
Upload File : |
<?php
declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Tests\Builder;
use PhpMyAdmin\SqlParser\Parser;
use PhpMyAdmin\SqlParser\Tests\TestCase;
class LockStatementTest extends TestCase
{
public function testBuilder(): void
{
/* Assertion 1 */
$query = 'LOCK TABLES table1 AS `t1` READ LOCAL';
$parser = new Parser($query);
$stmt = $parser->statements[0];
$this->assertEquals($query, $stmt->build());
/* Assertion 2 */
$query = 'LOCK TABLES table1 AS `t1` READ';
$parser = new Parser($query);
$stmt = $parser->statements[0];
$this->assertEquals($query, $stmt->build());
/* Assertion 3 */
$query = 'LOCK TABLES table1 AS `t1` LOW_PRIORITY WRITE';
$parser = new Parser($query);
$stmt = $parser->statements[0];
$this->assertEquals($query, $stmt->build());
/* Assertion 4 */
$query = 'LOCK TABLES table1 AS `t1` WRITE';
$parser = new Parser($query);
$stmt = $parser->statements[0];
$this->assertEquals($query, $stmt->build());
/* Assertion 5 */
$query = 'LOCK TABLES table1 AS `t1` READ LOCAL, table2 AS `t2` WRITE';
$parser = new Parser($query);
$stmt = $parser->statements[0];
$this->assertEquals($query, $stmt->build());
/* Assertion 6 */
$query = 'LOCK TABLES table1 READ LOCAL, table2 AS `t2` WRITE';
$parser = new Parser($query);
$stmt = $parser->statements[0];
$this->assertEquals($query, $stmt->build());
/* Assertion 7 */
$query = 'UNLOCK TABLES';
$parser = new Parser($query);
$stmt = $parser->statements[0];
$this->assertEquals($query, $stmt->build());
}
}