-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit e993f4c.
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BEAR\Sunday\Module\Cache; | ||
|
||
use Doctrine\Common\Cache\ArrayCache; | ||
use Doctrine\Common\Cache\Cache; | ||
use Ray\Di\AbstractModule; | ||
use Ray\Di\Scope; | ||
|
||
class DoctrineCacheModule extends AbstractModule | ||
{ | ||
protected function configure(): void | ||
{ | ||
$this->bind(Cache::class)->to(ArrayCache::class)->in(Scope::SINGLETON); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BEAR\Sunday\Module\Cache; | ||
|
||
use Doctrine\Common\Cache\Cache; | ||
use PHPUnit\Framework\TestCase; | ||
use Ray\Di\Injector; | ||
|
||
class DoctrineCacheModuleTest extends TestCase | ||
{ | ||
public function testGetInstance(): void | ||
{ | ||
$cache = (new Injector(new DoctrineCacheModule()))->getInstance(Cache::class); | ||
$this->assertInstanceOf(Cache::class, $cache); | ||
} | ||
} |