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:
11
tests/src/flextype/macros/CollectionTest.php
Normal file
11
tests/src/flextype/macros/CollectionTest.php
Normal 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']]);
|
||||
});
|
Reference in New Issue
Block a user