mirror of
https://github.com/dg/dibi.git
synced 2025-02-23 18:33:45 +01:00
27 lines
596 B
PHP
27 lines
596 B
PHP
<?php
|
|
|
|
use Tester\Assert;
|
|
|
|
require __DIR__ . '/bootstrap.php';
|
|
|
|
|
|
$conn = new Dibi\Connection($config);
|
|
|
|
// create new substitution :blog: ==> wp_
|
|
$conn->getSubstitutes()->blog = 'wp_';
|
|
|
|
Assert::same(
|
|
reformat('UPDATE wp_items SET [text]=\'Hello World\''),
|
|
$conn->translate("UPDATE :blog:items SET [text]='Hello World'")
|
|
);
|
|
|
|
Assert::same(
|
|
reformat('UPDATE \'wp_\' SET [text]=\'Hello World\''),
|
|
$conn->translate("UPDATE :blog: SET [text]='Hello World'")
|
|
);
|
|
|
|
Assert::same(
|
|
reformat('UPDATE \':blg:\' SET [text]=\'Hello World\''),
|
|
$conn->translate("UPDATE :blg: SET [text]='Hello World'")
|
|
);
|