Skip to content

Commit

Permalink
Fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Apr 26, 2024
1 parent cfe3f51 commit 7addec2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
15 changes: 11 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
parameters:
level: 6
paths:
- src
- tests
level: 6
paths:
- src
- tests

excludePaths:
- tests/Fixture/ContainerAwareMigration

ignoreErrors:
- '/Call to method setContainer\(\) on an unknown class Symfony\\Component\\DependencyInjection\\ContainerAwareInterface./'
- '/Class Symfony\\Component\\DependencyInjection\\ContainerAwareInterface not found./'
9 changes: 9 additions & 0 deletions tests/Factory/ContainerAwareVersionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Psr\Log\LoggerInterface;
use SyliusLabs\DoctrineMigrationsExtraBundle\Factory\ContainerAwareVersionFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Kernel;
use Tests\SyliusLabs\DoctrineMigrationsExtraBundle\Fixture\ContainerAwareMigration;
use Tests\SyliusLabs\DoctrineMigrationsExtraBundle\Fixture\NotContainerAwareMigration;

Expand All @@ -19,6 +20,10 @@ final class ContainerAwareVersionFactoryTest extends TestCase
/** @test */
public function migrations_implementing_container_aware_interface_are_injected_with_container(): void
{
if (Kernel::MAJOR_VERSION >= 7) {

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1, Symfony ^5.4

Comparison operation ">=" between 5 and 7 is always false.

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^7.0

Comparison operation ">=" between 7 and 7 is always true.

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^6.4

Comparison operation ">=" between 6 and 7 is always false.

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1, Symfony ^6.4

Comparison operation ">=" between 6 and 7 is always false.

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^5.4

Comparison operation ">=" between 5 and 7 is always false.

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^7.0

Comparison operation ">=" between 7 and 7 is always true.

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^6.4

Comparison operation ">=" between 6 and 7 is always false.

Check failure on line 23 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^5.4

Comparison operation ">=" between 5 and 7 is always false.
$this->markTestSkipped();
}

// Arrange
$decoratedFactory = $this->createMock(MigrationFactory::class);

Check failure on line 28 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^7.0

Unreachable statement - code above always terminates.

Check failure on line 28 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^7.0

Unreachable statement - code above always terminates.
$container = $this->createMock(ContainerInterface::class);
Expand All @@ -41,6 +46,10 @@ public function migrations_implementing_container_aware_interface_are_injected_w
/** @test */
public function migrations_not_implementing_container_aware_interface_are_not_injected_with_container(): void
{
if (Kernel::MAJOR_VERSION >= 7) {

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1, Symfony ^5.4

Comparison operation ">=" between 5 and 7 is always false.

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^7.0

Comparison operation ">=" between 7 and 7 is always true.

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^6.4

Comparison operation ">=" between 6 and 7 is always false.

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1, Symfony ^6.4

Comparison operation ">=" between 6 and 7 is always false.

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^5.4

Comparison operation ">=" between 5 and 7 is always false.

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^7.0

Comparison operation ">=" between 7 and 7 is always true.

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^6.4

Comparison operation ">=" between 6 and 7 is always false.

Check failure on line 49 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^5.4

Comparison operation ">=" between 5 and 7 is always false.
$this->markTestSkipped();
}

// Arrange
$decoratedFactory = $this->createMock(MigrationFactory::class);

Check failure on line 54 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3, Symfony ^7.0

Unreachable statement - code above always terminates.

Check failure on line 54 in tests/Factory/ContainerAwareVersionFactoryTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2, Symfony ^7.0

Unreachable statement - code above always terminates.
$container = $this->createMock(ContainerInterface::class);
Expand Down

0 comments on commit 7addec2

Please sign in to comment.