-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
EnableFeatureFactoryTest.php
37 lines (28 loc) · 1.14 KB
/
EnableFeatureFactoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
namespace Pheature\Test\Crud\Toggle\Handler;
use Pheature\Core\Toggle\Write\FeatureRepository;
use Pheature\Crud\Toggle\Handler\EnableFeature;
use Pheature\Crud\Toggle\Handler\EnableFeatureFactory;
use Psr\Container\ContainerInterface;
use PHPUnit\Framework\TestCase;
class EnableFeatureFactoryTest extends TestCase
{
public function testItShouldCreateInstanceOfEnableFeature(): void
{
$featureRepository = $this->createMock(FeatureRepository::class);
$container = $this->createMock(ContainerInterface::class);
$container->expects(static::once())
->method('get')
->with(FeatureRepository::class)
->willReturn($featureRepository);
$enableFeatureFactory = new EnableFeatureFactory();
$enableFeatureFactory->__invoke($container);
}
public function testItShouldCreateInstanceOfEnableFeatureStatically(): void
{
$featureRepository = $this->createMock(FeatureRepository::class);
$addStrategy = EnableFeatureFactory::create($featureRepository);
$this->assertInstanceOf(EnableFeature::class, $addStrategy);
}
}