Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue-135 [Toggle PSR-11 Factories] Add phpdoc to the returned value …
…from container
- Loading branch information
1 parent
0b6d267
commit 70bf494
Showing
2 changed files
with
37 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,31 @@ | ||
<?php | ||
|
||
namespace Pheature\Test\Crud\Psr11\Toggle; | ||
|
||
use Pheature\Core\Toggle\Write\FeatureRepository; | ||
use Pheature\Crud\Psr11\Toggle\RemoveStrategyFactory; | ||
use Pheature\Crud\Toggle\Handler\RemoveStrategy; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Container\ContainerInterface; | ||
|
||
class RemoveStrategyFactoryTest extends TestCase | ||
{ | ||
public function testItShouldCreateARemoveStrategyFromInvokable(): void | ||
{ | ||
$mockedContainer = $this->createConfiguredMock(ContainerInterface::class, [ | ||
'get' => $this->createMock(FeatureRepository::class) | ||
]); | ||
|
||
$factory = new RemoveStrategyFactory(); | ||
$actual = $factory->__invoke($mockedContainer); | ||
|
||
self::assertInstanceOf(RemoveStrategy::class, $actual); | ||
} | ||
|
||
public function testItShouldCreateARemoveStrategyFromCreate(): void | ||
{ | ||
$actual = RemoveStrategyFactory::create($this->createMock(FeatureRepository::class)); | ||
|
||
self::assertInstanceOf(RemoveStrategy::class, $actual); | ||
} | ||
} |