From c62bed7a2142c36ffd749417f646e46d5414b912 Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 2 May 2022 21:53:55 +0300 Subject: [PATCH] feat(tests): add tests for helpers --- tests/src/flextype/HelpersTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/src/flextype/HelpersTest.php b/tests/src/flextype/HelpersTest.php index 0496955d..dfb6b4a4 100644 --- a/tests/src/flextype/HelpersTest.php +++ b/tests/src/flextype/HelpersTest.php @@ -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([]));