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

feat(tests): add tests for collection macros

This commit is contained in:
Awilum
2022-05-31 18:07:25 +03:00
parent 144b197419
commit 3b208a9dbf

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
test('onlyFromCollection macros', function () {
expect(collection(['blog' => ['post-1' => 'Post 1', 'post-2' => 'Post 2']])->onlyFromCollection(['post-2'])->toArray())->toBe(['blog' => ['post-2' => 'Post 2']]);
});
test('exceptFromCollection macros', function () {
expect(collection(['blog' => ['post-1' => 'Post 1', 'post-2' => 'Post 2']])->exceptFromCollection(['post-1'])->toArray())->toBe(['blog' => ['post-2' => 'Post 2']]);
});