mirror of
https://github.com/flextype/flextype.git
synced 2025-08-06 13:16:45 +02:00
fix(tests): fixes for tests
This commit is contained in:
@@ -20,12 +20,12 @@ test('date expression', function () {
|
||||
|
||||
test('time expression', function () {
|
||||
$time = time();
|
||||
entries()->create('time', ['test' => '[[ time() ]]']);
|
||||
entries()->create('time', ['test' => '@type[int] [[ time() ]]']);
|
||||
expect(entries()->fetch('time')['test'])->toBe($time);
|
||||
});
|
||||
|
||||
test('strtotime expression', function () {
|
||||
$date = strtotime("10 September 2000");
|
||||
entries()->create('strtotime', ['test' => '[[ strtotime("10 September 2000"); ]]']);
|
||||
entries()->create('strtotime', ['test' => '[[ strtotime("10 September 2000") ]]']);
|
||||
expect(entries()->fetch('strtotime')['test'])->toBe($date);
|
||||
});
|
@@ -18,9 +18,9 @@ test('unless expression', function () {
|
||||
'title' => 'Title',
|
||||
|
||||
'test-unless-positive' => '[[ unless(title == "Foo", "Yes!") ]]',
|
||||
'test-unless-negative' => '[[ unless(title == "Title", "No!") ]]'
|
||||
'test-unless-negative' => '[[ unless(title == "Title", "Yes!") ]]'
|
||||
]);
|
||||
|
||||
expect(entries()->fetch('unless')['test-unless-positive'])->toBe('Yes!');
|
||||
expect(entries()->fetch('unless')['test-unless-negative'])->toBe('No!');
|
||||
expect(entries()->fetch('unless')['test-unless-negative'])->toBe('');
|
||||
});
|
@@ -18,9 +18,9 @@ test('when expression', function () {
|
||||
'title' => 'Title',
|
||||
|
||||
'test-when-positive' => '[[ when(title == "Title", "Yes!") ]]',
|
||||
'test-when-negative' => '[[ when(title == "Foo", "No!") ]]'
|
||||
'test-when-negative' => '[[ when(title == "Foo", "Yes!") ]]'
|
||||
]);
|
||||
|
||||
expect(entries()->fetch('when')['test-when-positive'])->toBe('Yes!');
|
||||
expect(entries()->fetch('when')['test-when-negative'])->toBe('No!');
|
||||
expect(entries()->fetch('when')['test-when-negative'])->toBe('');
|
||||
});
|
Reference in New Issue
Block a user