Skip to content

Commit

Permalink
Remove abandoned package (#88)
Browse files Browse the repository at this point in the history
* Change http-factory package

* Add bindInjector in test

* Up spiral/testing version

* Fix rebinding singletons
  • Loading branch information
msmakouz committed Oct 18, 2023
1 parent aa1716f commit 2cf49a9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
],
"require": {
"php": ">=8.1",
"psr/simple-cache": "3",
"php-http/message-factory": "^1.0",
"psr/simple-cache": "^3.0",
"psr/http-factory": "^1.0.2",
"grpc/grpc": "^1.42",
"roadrunner-php/centrifugo": "^2.0",
"spiral/roadrunner-http": "^3.0",
Expand All @@ -36,7 +36,7 @@
"spiral/scaffolder": "^3.7"
},
"require-dev": {
"spiral/testing": "^2.3",
"spiral/testing": "^2.6.1",
"phpunit/phpunit": "^10.1",
"vimeo/psalm": "^5.0",
"spiral/nyholm-bridge": "^1.2"
Expand Down
1 change: 0 additions & 1 deletion src/GRPC/Generator/BootloaderGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ private function updateInitServicesMethod(FileDeclaration $file, array $files):
{
$method = $file->getClass(self::BOOTLOADER_NAME)->getMethod('initServices');
$method->setBody('');

foreach ($files as $service) {
if (!\str_ends_with($service, 'Interface.php')) {
continue;
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Console/Command/Queue/ListCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

final class ListCommandTest extends ConsoleTestCase
{
public function testGetsListOfAvailablePipelines()
public function testGetsListOfAvailablePipelines(): void
{
$jobs = \Mockery::mock(JobsInterface::class);
$this->getContainer()->bind(JobsInterface::class, $jobs);
$this->getContainer()->bindSingleton(JobsInterface::class, $jobs, true);

$jobs->shouldReceive('getIterator')->andReturn(
new \ArrayIterator([
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Console/Command/Queue/PauseCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

final class PauseCommandTest extends ConsoleTestCase
{
public function testPausePipeline()
public function testPausePipeline(): void
{
$jobs = \Mockery::mock(JobsInterface::class);
$this->getContainer()->bind(JobsInterface::class, $jobs);
$this->getContainer()->bindSingleton(JobsInterface::class, $jobs, true);

$jobs->shouldReceive('pause')->once()->with('foo');

Expand Down
6 changes: 4 additions & 2 deletions tests/src/RoadRunnerModeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Spiral\Tests;

use PHPUnit\Framework\Attributes\DataProvider;
use Spiral\Boot\Injector\EnumInjector;
use Spiral\RoadRunner\Environment;
use Spiral\RoadRunner\EnvironmentInterface;
use Spiral\RoadRunnerBridge\RoadRunnerMode;
Expand All @@ -15,14 +16,15 @@ protected function setUp(): void
{
parent::setUp();
$this->getContainer()->removeBinding(RoadRunnerMode::class);
$this->getContainer()->bindInjector(RoadRunnerMode::class, EnumInjector::class);
}

#[DataProvider('roadRunnerModes')]
public function testDetectMode(string $mode, RoadRunnerMode $expected): void
{
$this->getContainer()->bind(EnvironmentInterface::class, static fn () => new Environment([
$this->getContainer()->bindSingleton(EnvironmentInterface::class, static fn () => new Environment([
'RR_MODE' => $mode,
]));
]), true);

$this->assertSame($expected, $this->getContainer()->get(RoadRunnerMode::class));
}
Expand Down

0 comments on commit 2cf49a9

Please sign in to comment.