We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cfba48 commit 31e30c2Copy full SHA for 31e30c2
tests/Unit/CacheKeyTest.php
@@ -0,0 +1,23 @@
1
+<?php namespace GeneaLabs\LaravelModelCaching\Tests\Unit;
2
+
3
+use GeneaLabs\LaravelModelCaching\CachedBuilder;
4
+use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Author;
5
+use GeneaLabs\LaravelModelCaching\Tests\UnitTestCase;
6
+use ReflectionMethod;
7
8
+class CacheKeyTest extends UnitTestCase
9
+{
10
+ public function testKeyIsSHA1()
11
+ {
12
+ $makeCacheKey = new ReflectionMethod(
13
+ CachedBuilder::class,
14
+ 'makeCacheKey'
15
+ );
16
+ $makeCacheKey->setAccessible(true);
17
18
+ $builder = (new Author)->startsWithA();
19
+ $key = $makeCacheKey->invoke($builder);
20
21
+ $this->assertTrue(strlen($key) === 40 && ctype_xdigit($key));
22
+ }
23
+}
0 commit comments