The following PHPUnit code has taken from their own website and it does not work for me, even though the documentation says it is working.
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class MultipleDependenciesTest extends TestCase
{
public function testProducerFirst(): string
{
$this->assertTrue(true);
return 'first';
}
public function testProducerSecond(): string
{
$this->assertTrue(true);
return 'second';
}
/**
* @depends testProducerFirst
* @depends testProducerSecond
*/
public function testConsumer(string $a, string $b): void
{
$this->assertSame('first', $a);
$this->assertSame('second', $b);
}
}
I get the following error:
- MultipleDependencyTest::testConsumer ArgumentCountError: Too few arguments to function MultipleDependencyTest::testConsumer(), 0 passed and exactly 2 expected`
composer show
(and if you only want to display the version:composer show phpunit/phpunit | grep versions
).