mirror of
https://github.com/dg/dibi.git
synced 2025-02-24 02:43:09 +01:00
31 lines
600 B
Plaintext
31 lines
600 B
Plaintext
|
<?php
|
||
|
|
||
|
use Tester\Assert;
|
||
|
|
||
|
require __DIR__ . '/bootstrap.php';
|
||
|
|
||
|
|
||
|
$conn = new DibiConnection($config);
|
||
|
|
||
|
|
||
|
$arr = array(
|
||
|
'title' => 'Super Product',
|
||
|
'price' => 12,
|
||
|
'brand' => NULL,
|
||
|
);
|
||
|
|
||
|
$fluent = $conn->update('table', $arr)
|
||
|
->setFlag('IGNORE')->setFlag('DELAYED');
|
||
|
|
||
|
Assert::same(
|
||
|
reformat('UPDATE IGNORE DELAYED [table] SET [title]=\'Super Product\', [price]=12, [brand]=NULL'),
|
||
|
(string) $fluent
|
||
|
);
|
||
|
|
||
|
$fluent->set(array('another' => 123));
|
||
|
|
||
|
Assert::same(
|
||
|
reformat('UPDATE IGNORE DELAYED [table] SET [title]=\'Super Product\', [price]=12, [brand]=NULL , [another]=123'),
|
||
|
(string) $fluent
|
||
|
);
|