1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 13:16:45 +02:00

feat(tests): add tests for helpers

This commit is contained in:
Awilum
2022-05-02 21:56:23 +03:00
parent c62bed7a21
commit 21bce813da

View File

@@ -99,19 +99,19 @@ test('slugify helper', function () {
});
test('collection helper', function () {
$this->assertEquals([], collection([]));
$this->assertEquals([], collection([])->toArray());
});
test('collectionFromJson helper', function () {
$this->assertEquals(['foo'], collectionFromJson("{\"foo\"}"));
$this->assertEquals(['foo'], collectionFromJson("{\"foo\"}")->toArray());
});
test('collectionFromString helper', function () {
$this->assertEquals(['foo', 'bar'], collectionFromString('foo, bar', ','));
$this->assertEquals(['foo', 'bar'], collectionFromString('foo, bar', ',')->toArray());
});
test('collectionWithRange helper', function () {
$this->assertEquals([0, 1], collectionWithRange(0, 1, 1));
$this->assertEquals([0, 1], collectionWithRange(0, 1, 1)->toArray());
});
test('filterCollection helper', function () {