1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 05:07:41 +02:00

feat(tests): add tests for helpers

This commit is contained in:
Awilum
2022-05-02 21:53:55 +03:00
parent 427224e75a
commit c62bed7a21

View File

@@ -98,6 +98,22 @@ test('slugify helper', function () {
expect(slugify())->toBeInstanceOf(Slugify::class);
});
test('collection helper', function () {
$this->assertEquals([], collection([]));
});
test('collectionFromJson helper', function () {
$this->assertEquals(['foo'], collectionFromJson("{\"foo\"}"));
});
test('collectionFromString helper', function () {
$this->assertEquals(['foo', 'bar'], collectionFromString('foo, bar', ','));
});
test('collectionWithRange helper', function () {
$this->assertEquals([0, 1], collectionWithRange(0, 1, 1));
});
test('filterCollection helper', function () {
$this->assertEquals([], filterCollection());
$this->assertEquals([], filterCollection([]));