-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Upgrade to phpstan 2, phpunit 12 and allow safe 3
- Loading branch information
Showing
17 changed files
with
109 additions
and
67 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
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
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
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
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
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
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,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Brainbits\FunctionalTestHelpers\Tests\Application; | ||
|
||
use Brainbits\FunctionalTestHelpers\Console\ApplicationTrait; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\DependencyInjection\Container; | ||
use Symfony\Component\EventDispatcher\EventDispatcher; | ||
use Symfony\Component\HttpKernel\KernelInterface; | ||
|
||
final class ApplicationTraitTest extends TestCase | ||
{ | ||
use ApplicationTrait; | ||
|
||
private static KernelInterface|null $kernel = null; | ||
|
||
public function testMockRequest(): void | ||
{ | ||
$container = new Container(); | ||
$container->set('event_dispatcher', new EventDispatcher()); | ||
|
||
self::$kernel = $this->createMock(KernelInterface::class); | ||
self::$kernel->expects($this->atLeastOnce()) | ||
->method('getContainer') | ||
->willReturn($container); | ||
|
||
$tester = $this->runApplication(['help']); | ||
|
||
$this->assertApplicationOutputContains('help', $tester); | ||
|
||
self::$kernel->shutdown(); | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Brainbits\FunctionalTestHelpers\Tests\Console; | ||
|
||
use Brainbits\FunctionalTestHelpers\Console\CommandTrait; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\DependencyInjection\Container; | ||
use Symfony\Component\HttpKernel\KernelInterface; | ||
|
||
final class CommandTraitTest extends TestCase | ||
{ | ||
use CommandTrait; | ||
|
||
private static KernelInterface|null $kernel = null; | ||
|
||
public function testMockRequest(): void | ||
{ | ||
$container = new Container(); | ||
|
||
self::$kernel = $this->createMock(KernelInterface::class); | ||
self::$kernel->expects($this->atLeastOnce()) | ||
->method('getContainer') | ||
->willReturn($container); | ||
|
||
$tester = $this->runCommand('help'); | ||
|
||
$this->assertCommandOutputContains('help', $tester); | ||
} | ||
} |
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
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