From aa50b5a580ed1defd4a5956ee182d807c4dbad27 Mon Sep 17 00:00:00 2001 From: Awilum Date: Wed, 21 Oct 2020 10:50:47 +0300 Subject: [PATCH] feat(tests): add tests for Serializer Frontmatter getCacheID() #477 --- tests/Support/Serializers/FrontmatterTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/Support/Serializers/FrontmatterTest.php b/tests/Support/Serializers/FrontmatterTest.php index 57883e2b..b4be6ec0 100644 --- a/tests/Support/Serializers/FrontmatterTest.php +++ b/tests/Support/Serializers/FrontmatterTest.php @@ -15,3 +15,11 @@ test('test decode() method', function () { flextype('frontmatter') ->decode("---\ntitle: Foo\n---\nBar")); }); + +test('test getCacheID() method', function () { + $string = "---\ntitle: Foo\n---\nBar"; + $cache_id = flextype('frontmatter') + ->getCacheID($string); + $this->assertEquals(32, strlen($cache_id)); + $this->assertNotEquals($string, $cache_id); +});