mirror of
https://github.com/dg/dibi.git
synced 2025-08-26 15:34:22 +02:00
coding style
This commit is contained in:
@@ -12,22 +12,32 @@ Assert::same(0, Helpers::intVal(0));
|
||||
Assert::same(0, Helpers::intVal('0'));
|
||||
Assert::same(-10, Helpers::intVal('-10'));
|
||||
|
||||
Assert::exception(function () {
|
||||
Helpers::intVal('12345678901234567890123456879');
|
||||
}, Dibi\Exception::class, 'Number 12345678901234567890123456879 is greater than integer.');
|
||||
Assert::exception(
|
||||
fn() => Helpers::intVal('12345678901234567890123456879'),
|
||||
Dibi\Exception::class,
|
||||
'Number 12345678901234567890123456879 is greater than integer.',
|
||||
);
|
||||
|
||||
Assert::exception(function () {
|
||||
Helpers::intVal('-12345678901234567890123456879');
|
||||
}, Dibi\Exception::class, 'Number -12345678901234567890123456879 is greater than integer.');
|
||||
Assert::exception(
|
||||
fn() => Helpers::intVal('-12345678901234567890123456879'),
|
||||
Dibi\Exception::class,
|
||||
'Number -12345678901234567890123456879 is greater than integer.',
|
||||
);
|
||||
|
||||
Assert::exception(function () {
|
||||
Helpers::intVal('');
|
||||
}, Dibi\Exception::class, "Expected number, '' given.");
|
||||
Assert::exception(
|
||||
fn() => Helpers::intVal(''),
|
||||
Dibi\Exception::class,
|
||||
"Expected number, '' given.",
|
||||
);
|
||||
|
||||
Assert::exception(function () {
|
||||
Helpers::intVal('not number');
|
||||
}, Dibi\Exception::class, "Expected number, 'not number' given.");
|
||||
Assert::exception(
|
||||
fn() => Helpers::intVal('not number'),
|
||||
Dibi\Exception::class,
|
||||
"Expected number, 'not number' given.",
|
||||
);
|
||||
|
||||
Assert::exception(function () {
|
||||
Helpers::intVal(null);
|
||||
}, Dibi\Exception::class, "Expected number, '' given.");
|
||||
Assert::exception(
|
||||
fn() => Helpers::intVal(null),
|
||||
Dibi\Exception::class,
|
||||
"Expected number, '' given.",
|
||||
);
|
||||
|
Reference in New Issue
Block a user