Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions tests/Integration/Cache/MemoizedStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,32 @@
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Exceptions;
use Illuminate\Support\Facades\Redis;
use Orchestra\Testbench\Attributes\WithConfig;
use Orchestra\Testbench\TestCase;
use Throwable;

#[WithConfig('cache.default', 'redis')]
#[WithConfig('cache.prefix', 'laravel_cache_')]
class MemoizedStoreTest extends TestCase
{
use InteractsWithRedis;

/** {@inheritdoc} */
#[\Override]
protected function setUp(): void
{
parent::setUp();

$this->setUpRedis();
$this->afterApplicationCreated(function () {
$this->setUpRedis();

Config::set('cache.default', 'redis');
Redis::connection(Config::get('cache.stores.redis.connection'))->flushDb();
Redis::connection(Config::get('cache.stores.redis.lock_connection'))->flushDb();
}
Redis::connection(Config::get('cache.stores.redis.connection'))->flushDb();
Redis::connection(Config::get('cache.stores.redis.lock_connection'))->flushDb();
});

protected function tearDown(): void
{
parent::tearDown();
$this->beforeApplicationDestroyed(function () {
$this->tearDownRedis();
});

$this->tearDownRedis();
parent::setUp();
}

public function test_it_can_memoize_when_retrieving_single_value()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Illuminate\Tests\Container;
namespace Illuminate\Tests\Integration\Container;

use Illuminate\Container\Attributes\Config;
use Illuminate\Contracts\Container\SelfBuilding;
Expand Down
Loading