mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
Fix #31 CacheManager didn't merge tags properly; write tests for CacheManager
This commit is contained in:
parent
e463829e53
commit
a2d68b1261
3 changed files with 31 additions and 10 deletions
|
|
@ -7,18 +7,34 @@ class CacheManagerTest extends TestCase
|
|||
/** @test */
|
||||
public function default_tag_is_automatically_applied()
|
||||
{
|
||||
$this->markTestIncomplete('see BootstrapsTenancyTest@cache_is_tagged');
|
||||
$this->assertArraySubset([config('tenancy.cache.tag_base') . tenant('uuid')], cache()->tags('foo')->getTags()->getNames());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function tags_are_merged_when_array_is_passed()
|
||||
{
|
||||
$this->markTestIncomplete('see BootstrapsTenancyTest@cache_is_tagged');
|
||||
$expected = [config('tenancy.cache.tag_base') . tenant('uuid'), 'foo', 'bar'];
|
||||
$this->assertEquals($expected, cache()->tags(['foo', 'bar'])->getTags()->getNames());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function tags_are_merged_when_string_is_passed()
|
||||
{
|
||||
$this->markTestIncomplete('see BootstrapsTenancyTest@cache_is_tagged');
|
||||
$expected = [config('tenancy.cache.tag_base') . tenant('uuid'), 'foo'];
|
||||
$this->assertEquals($expected, cache()->tags('foo')->getTags()->getNames());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function exception_is_thrown_when_zero_arguments_are_passed_to_tags_method()
|
||||
{
|
||||
$this->expectException(\Exception::class);
|
||||
cache()->tags();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function exception_is_thrown_when_more_than_one_argument_is_passed_to_tags_method()
|
||||
{
|
||||
$this->expectException(\Exception::class);
|
||||
cache()->tags(1, 2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue