Skip to content

Commit d418fdb

Browse files
committed
Bring all tests to green, fixed cache prefix
1 parent dc68057 commit d418fdb

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

src/CacheKey.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class CacheKey
1313
protected function getCachePrefix() : string
1414
{
1515
return "genealabs:laravel-model-caching:"
16-
. (config('genealabs:laravel-model-caching', '')
17-
? config('genealabs:laravel-model-caching', '') . ":"
16+
. (config('laravel-model-caching.cache-prefix')
17+
? config('laravel-model-caching.cache-prefix', '') . ":"
1818
: "");
1919
}
2020

src/CacheTags.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public function __construct(array $eagerLoad, Model $model)
1818
protected function getCachePrefix() : string
1919
{
2020
return "genealabs:laravel-model-caching:"
21-
. (config('genealabs:laravel-model-caching', '')
22-
? config('genealabs:laravel-model-caching', '') . ":"
21+
. (config('laravel-model-caching.cache-prefix')
22+
? config('laravel-model-caching.cache-prefix', '') . ":"
2323
: "");
2424
}
2525

tests/Fixtures/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class BaseModel extends Model
1111

1212
public function __construct($attributes = [])
1313
{
14-
config(['genealabs:laravel-model-caching' => 'test-prefix']);
14+
config(['laravel-model-caching.cache-prefix' => 'test-prefix']);
1515

1616
parent::__construct($attributes);
1717
}

tests/Unit/CachedBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ public function testWhereNotInResults()
800800
$this->assertTrue($cachedResults->diffKeys($books)->isEmpty());
801801
$this->assertTrue($liveResults->diffKeys($books)->isEmpty());
802802
}
803-
/** @group test */
803+
804804
public function testHashCollision()
805805
{
806806
$this->cache()->flush();

tests/Unit/Console/Commands/FlushTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testNonCachedModelsCannotBeFlushed()
9393

9494
$this->assertEquals($result, 1);
9595
}
96-
/** @group test */
96+
9797
public function testAllModelsAreFlushed()
9898
{
9999
(new Author)->all();

tests/Unit/Traits/CachableTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public function testSetCachePrefixAttribute()
5050
(new PrefixedAuthor)->get();
5151

5252
$results = $this->cache()
53-
->tags([
54-
'genealabs:laravel-model-caching:test-prefix:genealabslaravelmodelcachingtestsfixturesprefixedauthor',
55-
])
53+
->tags(['genealabs:laravel-model-caching:test-prefix:genealabslaravelmodelcachingtestsfixturesprefixedauthor'])
5654
->get(sha1('genealabs:laravel-model-caching:test-prefix:genealabslaravelmodelcachingtestsfixturesprefixedauthor'))['value'];
5755

5856
$this->assertNotNull($results);

0 commit comments

Comments
 (0)