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:
@@ -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([]));
|
||||
|
Reference in New Issue
Block a user