File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use DirectoryTree \ActiveRedis \Repositories \ArrayRepository ;
4+ use DirectoryTree \ActiveRedis \Repositories \RedisRepository ;
5+ use DirectoryTree \ActiveRedis \Repositories \RepositoryFactory ;
6+ use DirectoryTree \ActiveRedis \Tests \Stubs \ModelStub ;
7+ use DirectoryTree \ActiveRedis \Tests \Stubs \NullRepository ;
8+
9+ it ('can resolve redis repository ' , function () {
10+ $ repository = (new RepositoryFactory )->make (new ModelStub );
11+
12+ expect ($ repository )->toBeInstanceOf (RedisRepository::class);
13+ });
14+
15+ it ('can resolve array repository ' , function () {
16+ ModelStub::setRepository ('array ' );
17+
18+ $ repository = (new RepositoryFactory )->make (new ModelStub );
19+
20+ expect ($ repository )->toBeInstanceOf (ArrayRepository::class);
21+ });
22+
23+ it ('can resolve custom repository ' , function () {
24+ ModelStub::setRepository (NullRepository::class);
25+
26+ $ repository = (new RepositoryFactory )->make (new ModelStub );
27+
28+ expect ($ repository )->toBeInstanceOf (NullRepository::class);
29+ });
You can’t perform that action at this time.
0 commit comments