Skip to content

Commit

Permalink
update psalm to 5.16
Browse files Browse the repository at this point in the history
  • Loading branch information
kpicaza committed Dec 3, 2023
1 parent 43bffce commit 45878d8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": "~8.0.0|~8.1.0|~8.2.0|~8.3.0",
"pheature/toggle-core": "^0.7",
"pheature/toggle-core": "^0.8",
"psr/event-dispatcher": "^1.0"
},
"require-dev": {
Expand All @@ -28,8 +28,8 @@
"phpunit/phpunit": "^8.0 || ^9.0",
"roave/infection-static-analysis-plugin": "^1.18",
"squizlabs/php_codesniffer": "^3.4",
"symfony/var-dumper": "^4.2 || ^5.0 || ^6.0",
"vimeo/psalm": "^4.4"
"symfony/var-dumper": "^4.2 || ^5.0 || ^6.0 || ^7.0",
"vimeo/psalm": "^4.4|^5.16"
},
"autoload": {
"psr-4": {
Expand Down
37 changes: 37 additions & 0 deletions test/Handler/EnableFeatureFactoryTest.php
@@ -0,0 +1,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);
}
}
1 change: 1 addition & 0 deletions test/Handler/RemoveFeatureTest.php
Expand Up @@ -37,5 +37,6 @@ public function testItShouldRemoveAFeature(): void

$handler = new RemoveFeature($repository);
$handler->handle($command);
$this->assertCount(2, $expectedFeature->release());
}
}

0 comments on commit 45878d8

Please sign in to comment.