-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
DisableFeatureFactoryTest.php
35 lines (27 loc) · 1.12 KB
/
DisableFeatureFactoryTest.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
<?php
namespace Pheature\Test\Crud\Toggle\Handler;
use Pheature\Core\Toggle\Write\FeatureRepository;
use Pheature\Crud\Toggle\Handler\DisableFeatureFactory;
use Pheature\Crud\Toggle\Handler\DisableFeature;
use Psr\Container\ContainerInterface;
use PHPUnit\Framework\TestCase;
class DisableFeatureFactoryTest extends TestCase
{
public function testItShouldCreateInstanceOfCreateFeature(): void
{
$featureRepository = $this->createMock(FeatureRepository::class);
$container = $this->createMock(ContainerInterface::class);
$container->expects(static::once())
->method('get')
->with(FeatureRepository::class)
->willReturn($featureRepository);
$disableFeatureFactory = new DisableFeatureFactory();
$disableFeatureFactory->__invoke($container);
}
public function testItShouldCreateInstanceOfCreateFeatureStatically(): void
{
$featureRepository = $this->createMock(FeatureRepository::class);
$addStrategy = DisableFeatureFactory::create($featureRepository);
$this->assertInstanceOf(DisableFeature::class, $addStrategy);
}
}