connection = new PdoConnection($config); try { $this->connection->pdo(); } catch (MyException $e) { $this->markTestSkipped('Нет живого подключения к MariaDB (заполните App/config/config.local.php): ' . $e->getMessage()); } } protected function tearDown(): void { Profiler::reset(); } public function testShowQuerySubstitutesPositionalParams(): void { $statement = $this->connection->query('SELECT ? AS a, ? AS b', ['foo', 42]); $this->assertSame("SELECT 'foo' AS a, 42 AS b", $statement->showQuery()); } public function testShowQuerySubstitutesNamedParams(): void { $statement = $this->connection->query('SELECT :name AS name', ['name' => 'bicycle']); $this->assertSame("SELECT 'bicycle' AS name", $statement->showQuery()); } public function testSqIsAliasForShowQuery(): void { $statement = $this->connection->query('SELECT ? AS a', ['foo']); $this->assertSame($statement->showQuery(), $statement->sq()); } }