这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"psr/container": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^11.5.9",
"zalas/phpunit-globals": "^3.5",
"phpunit/phpunit": "^11.5.9 || ^12.0",
"zalas/phpunit-globals": "^4.0",
"infection/infection": "^0.29",
"deptrac/deptrac": "^3.0"
},
Expand Down
5 changes: 1 addition & 4 deletions tests/Cli/ServiceContainer/RunnerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Zalas\Toolbox\Tests\Cli\ServiceContainer;

use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerExceptionInterface;
Expand Down Expand Up @@ -43,7 +42,7 @@ class RunnerFactoryTest extends TestCase
protected function setUp(): void
{
$this->input = $this->givenInput([]);
$this->output = $this->createStub(OutputInterface::class);
$this->output = $this->createMock(OutputInterface::class);

$this->container = new class([ InputInterface::class => &$this->input, OutputInterface::class => &$this->output, ]) implements ContainerInterface {

Expand Down Expand Up @@ -90,7 +89,6 @@ public function test_it_creates_the_parametrised_runner_if_target_dir_option_is_
$this->assertInstanceOf(ParametrisedRunner::class, $runner);
}

#[DoesNotPerformAssertions]
public function test_the_parametrised_runner_includes_the_target_dir_parameter()
{
$this->givenInput(['--target-dir' => '/usr/local/bin', '--dry-run' => true]);
Expand All @@ -116,7 +114,6 @@ public function test_it_throws_an_exception_if_target_dir_does_not_exist()
$this->runnerFactory->createRunner();
}

#[DoesNotPerformAssertions]
public function test_it_uses_the_real_path_as_target_dir()
{
$this->givenInput(['--target-dir' => __DIR__.'/../../../bin', '--dry-run' => true]);
Expand Down
5 changes: 2 additions & 3 deletions tests/Cli/ServiceContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Cli;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
Expand Down Expand Up @@ -39,9 +40,7 @@ public function test_it_returns_false_if_service_is_not_registered()
$this->assertFalse($this->container->has('foo'));
}

/**
* @dataProvider provideApplicationServices
*/
#[DataProvider('provideApplicationServices')]
public function test_it_creates_application_services(string $serviceId, string $expectedType)
{
$this->assertTrue($this->container->has($serviceId));
Expand Down
5 changes: 2 additions & 3 deletions tests/Json/Factory/BoxBuildCommandFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Json\Factory;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Zalas\Toolbox\Json\Factory\BoxBuildCommandFactory;
use Zalas\Toolbox\Tool\Command\BoxBuildCommand;
Expand Down Expand Up @@ -40,9 +41,7 @@ public function test_the_version_is_not_required()
$this->assertInstanceOf(BoxBuildCommand::class, $command);
}

/**
* @dataProvider provideRequiredProperties
*/
#[DataProvider('provideRequiredProperties')]
public function test_it_complains_if_any_of_required_properties_is_missing(string $property)
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
5 changes: 2 additions & 3 deletions tests/Json/Factory/ComposerBinPluginCommandFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Json\Factory;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Zalas\Toolbox\Json\Factory\ComposerBinPluginCommandFactory;
use Zalas\Toolbox\Tool\Collection;
Expand Down Expand Up @@ -40,9 +41,7 @@ public function test_it_creates_a_command_with_links_in_tools()
);
}

/**
* @dataProvider provideRequiredProperties
*/
#[DataProvider('provideRequiredProperties')]
public function test_it_complains_if_any_of_required_properties_is_missing(string $property)
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
7 changes: 3 additions & 4 deletions tests/Json/Factory/ComposerInstallCommandFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Json\Factory;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Zalas\Toolbox\Json\Factory\ComposerInstallCommandFactory;
use Zalas\Toolbox\Tool\Command\ComposerInstallCommand;
Expand All @@ -24,9 +25,7 @@ public function test_it_creates_a_command()
$this->assertMatchesRegularExpression('#git checkout '.self::VERSION.'#', (string) $command);
}

/**
* @dataProvider provideRequiredProperties
*/
#[DataProvider('provideRequiredProperties')]
public function test_it_complains_if_a_required_property_is_missing(string $property)
{
$this->expectException(\InvalidArgumentException::class);
Expand All @@ -41,7 +40,7 @@ public function test_it_complains_if_a_required_property_is_missing(string $prop
ComposerInstallCommandFactory::import($properties);
}

public static function provideRequiredProperties()
public static function provideRequiredProperties(): \Generator
{
yield ['repository'];
yield ['target-dir'];
Expand Down
5 changes: 2 additions & 3 deletions tests/Json/Factory/FileDownloadCommandFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Json\Factory;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Zalas\Toolbox\Json\Factory\FileDownloadCommandFactory;
use Zalas\Toolbox\Tool\Command\FileDownloadCommand;
Expand All @@ -21,9 +22,7 @@ public function test_it_creates_a_command()
$this->assertInstanceOf(FileDownloadCommand::class, $command);
}

/**
* @dataProvider provideRequiredProperties
*/
#[DataProvider('provideRequiredProperties')]
public function test_it_complains_if_any_of_required_properties_is_missing(string $property)
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
5 changes: 2 additions & 3 deletions tests/Json/Factory/PharDownloadCommandFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Json\Factory;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Zalas\Toolbox\Json\Factory\PharDownloadCommandFactory;
use Zalas\Toolbox\Tool\Command\PharDownloadCommand;
Expand All @@ -21,9 +22,7 @@ public function test_it_creates_a_command()
$this->assertInstanceOf(PharDownloadCommand::class, $command);
}

/**
* @dataProvider provideRequiredProperties
*/
#[DataProvider('provideRequiredProperties')]
public function test_it_complains_if_any_of_required_properties_is_missing(string $property)
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
5 changes: 2 additions & 3 deletions tests/Json/Factory/PhiveInstallCommandFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Json\Factory;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Zalas\Toolbox\Json\Factory\PhiveInstallCommandFactory;
use Zalas\Toolbox\Tool\Command\PhiveInstallCommand;
Expand All @@ -24,9 +25,7 @@ public function test_it_creates_a_command()
$this->assertStringNotContainsString('unsigned', (string)$command);
}

/**
* @dataProvider provideRequiredProperties
*/
#[DataProvider('provideRequiredProperties')]
public function test_it_complains_if_any_of_required_properties_is_missing(string $property)
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
5 changes: 2 additions & 3 deletions tests/Json/Factory/ToolFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Zalas\Toolbox\Tests\Json\Factory;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Zalas\Toolbox\Json\Factory\ToolFactory;
use Zalas\Toolbox\Tool\Command;
Expand Down Expand Up @@ -195,9 +196,7 @@ public function test_it_complains_if_the_command_is_empty()
ToolFactory::import($this->definition(['command' => []]));
}

/**
* @dataProvider provideRequiredProperties
*/
#[DataProvider('provideRequiredProperties')]
public function test_it_complains_if_any_of_required_properties_is_missing(string $property)
{
$this->expectException(\InvalidArgumentException::class);
Expand Down