mirror of
https://github.com/dg/dibi.git
synced 2025-08-29 16:59:49 +02:00
new directory structure, moved to /src
This commit is contained in:
45
tests/dibi/Fluent.delete.phpt
Normal file
45
tests/dibi/Fluent.delete.phpt
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
|
||||
$conn = new DibiConnection($config);
|
||||
|
||||
|
||||
$fluent = $conn->delete('table')->as('bAlias')
|
||||
->setFlag('IGNORE');
|
||||
|
||||
Assert::same(
|
||||
reformat('DELETE IGNORE FROM [table] AS [bAlias]'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
||||
$fluent->removeClause('from')->from('anotherTable');
|
||||
|
||||
Assert::same(
|
||||
reformat('DELETE IGNORE FROM [anotherTable]'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
||||
$fluent->using('thirdTable');
|
||||
|
||||
Assert::same(
|
||||
reformat('DELETE IGNORE FROM [anotherTable] USING [thirdTable]'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
||||
$fluent->setFlag('IGNORE', FALSE);
|
||||
|
||||
Assert::same(
|
||||
reformat('DELETE FROM [anotherTable] USING [thirdTable]'),
|
||||
(string) $fluent
|
||||
);
|
||||
|
||||
$fluent->limit(10);
|
||||
|
||||
Assert::same(
|
||||
reformat('DELETE FROM [anotherTable] USING [thirdTable] LIMIT 10'),
|
||||
(string) $fluent
|
||||
);
|
Reference in New Issue
Block a user