SyntaxTest.php
Same filename in this branch
Same filename and directory in other branches
Namespace
Drupal\Tests\mysqli\Kernel\mysqliFile
-
core/
modules/ mysqli/ tests/ src/ Kernel/ mysqli/ SyntaxTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\mysqli\Kernel\mysqli;
use Drupal\KernelTests\Core\Database\DriverSpecificSyntaxTestBase;
use PHPUnit\Framework\Attributes\Group;
/**
* Tests MySql syntax interpretation.
*/
class SyntaxTest extends DriverSpecificSyntaxTestBase {
/**
* Tests string concatenation with separator, with field values.
*/
public function testConcatWsFields() : void {
$result = $this->connection
->query("SELECT CONCAT_WS('-', CONVERT(:a1 USING utf8mb4), [name], CONVERT(:a2 USING utf8mb4), [age]) FROM {test} WHERE [age] = :age", [
':a1' => 'name',
':a2' => 'age',
':age' => 25,
]);
$this->assertSame('name-John-age-25', $result->fetchField());
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
SyntaxTest | Tests MySql syntax interpretation. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.