Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3b4854
commit 01e6667
Showing
2 changed files
with
42 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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pheature\Test\Crud\Psr11\Toggle; | ||
|
||
use Pheature\Core\Toggle\Write\FeatureRepository; | ||
use Pheature\Crud\Psr11\Toggle\AddStrategyFactory; | ||
use Pheature\Crud\Toggle\Handler\AddStrategy; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Container\ContainerInterface; | ||
|
||
final class AddStrategyFactoryTest extends TestCase | ||
{ | ||
public function testItShouldCreateInstanceOfAddStrategy(): void | ||
{ | ||
$featureRepository = $this->createMock(FeatureRepository::class); | ||
$container = $this->createMock(ContainerInterface::class); | ||
$container->expects(static::once()) | ||
->method('get') | ||
->with(FeatureRepository::class) | ||
->willReturn($featureRepository); | ||
|
||
$addStrategyFactory = new AddStrategyFactory(); | ||
|
||
$addStrategyFactory->__invoke($container); | ||
} | ||
|
||
public function testItShouldCreateInstanceOfAddStrategyStatically(): void | ||
{ | ||
$featureRepository = $this->createMock(FeatureRepository::class); | ||
|
||
$addStrategy = AddStrategyFactory::create($featureRepository); | ||
|
||
$this->assertInstanceOf(AddStrategy::class, $addStrategy); | ||
} | ||
} |