mirror of
https://github.com/dg/dibi.git
synced 2025-09-02 10:32:33 +02:00
coding style
This commit is contained in:
@@ -21,19 +21,19 @@ $tests = function ($conn) {
|
||||
// Limit and offset
|
||||
Assert::same(
|
||||
'SELECT 1 OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY',
|
||||
$conn->translate('SELECT 1 %ofs %lmt', 10, 10)
|
||||
$conn->translate('SELECT 1 %ofs %lmt', 10, 10),
|
||||
);
|
||||
|
||||
// Limit only
|
||||
Assert::same(
|
||||
'SELECT 1 OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY',
|
||||
$conn->translate('SELECT 1 %lmt', 10)
|
||||
$conn->translate('SELECT 1 %lmt', 10),
|
||||
);
|
||||
|
||||
// Offset only
|
||||
Assert::same(
|
||||
'SELECT 1 OFFSET 10 ROWS',
|
||||
$conn->translate('SELECT 1 %ofs', 10)
|
||||
$conn->translate('SELECT 1 %ofs', 10),
|
||||
);
|
||||
|
||||
// Offset invalid
|
||||
@@ -42,7 +42,7 @@ $tests = function ($conn) {
|
||||
$conn->translate('SELECT 1 %ofs', -10);
|
||||
},
|
||||
Dibi\NotSupportedException::class,
|
||||
'Negative offset or limit.'
|
||||
'Negative offset or limit.',
|
||||
);
|
||||
|
||||
// Limit invalid
|
||||
@@ -51,7 +51,7 @@ $tests = function ($conn) {
|
||||
$conn->translate('SELECT 1 %lmt', -10);
|
||||
},
|
||||
Dibi\NotSupportedException::class,
|
||||
'Negative offset or limit.'
|
||||
'Negative offset or limit.',
|
||||
);
|
||||
|
||||
// Limit invalid, offset valid
|
||||
@@ -60,7 +60,7 @@ $tests = function ($conn) {
|
||||
$conn->translate('SELECT 1 %ofs %lmt', 10, -10);
|
||||
},
|
||||
Dibi\NotSupportedException::class,
|
||||
'Negative offset or limit.'
|
||||
'Negative offset or limit.',
|
||||
);
|
||||
|
||||
// Limit valid, offset invalid
|
||||
@@ -69,22 +69,22 @@ $tests = function ($conn) {
|
||||
$conn->translate('SELECT 1 %ofs %lmt', -10, 10);
|
||||
},
|
||||
Dibi\NotSupportedException::class,
|
||||
'Negative offset or limit.'
|
||||
'Negative offset or limit.',
|
||||
);
|
||||
} else {
|
||||
Assert::same(
|
||||
'SELECT TOP (1) * FROM (SELECT 1) t',
|
||||
$conn->translate('SELECT 1 %lmt', 1)
|
||||
$conn->translate('SELECT 1 %lmt', 1),
|
||||
);
|
||||
|
||||
Assert::same(
|
||||
'SELECT 1',
|
||||
$conn->translate('SELECT 1 %lmt', -10)
|
||||
$conn->translate('SELECT 1 %lmt', -10),
|
||||
);
|
||||
|
||||
Assert::exception(
|
||||
$conn->translate('SELECT 1 %ofs %lmt', 10, 10),
|
||||
Dibi\NotSupportedException::class
|
||||
Dibi\NotSupportedException::class,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user