From 3b208a9dbf7ed6f935a0fca3d38a6cb5f65e388e Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 31 May 2022 18:07:25 +0300 Subject: [PATCH] feat(tests): add tests for collection macros --- tests/src/flextype/macros/CollectionTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/src/flextype/macros/CollectionTest.php diff --git a/tests/src/flextype/macros/CollectionTest.php b/tests/src/flextype/macros/CollectionTest.php new file mode 100644 index 00000000..dc17758f --- /dev/null +++ b/tests/src/flextype/macros/CollectionTest.php @@ -0,0 +1,11 @@ + ['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']]); +}); \ No newline at end of file