I am new to Magento 2. I am testing a class with PhpUnit.
When I run the test I obtain this error:
ArgumentCountError : Too few arguments to function Magenio\Todo\Test\Unit\Service\TaskRepositoryTest::testGetList(), 0 passed in /opt/project/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 1414 and exactly 1 expected
I checked the TestCase.php
file and the line 1414 and related lines are those:
protected function runTest()
{
if (\trim($this->name) === '') {
throw new Exception(
'PHPUnit\Framework\TestCase::$name must be a non-blank string.'
);
}
$testArguments = \array_merge($this->data, $this->dependencyInput);
$this->registerMockObjectsFromTestArguments($testArguments);
try {
$testResult = $this->{$this->name}(...\array_values($testArguments));
} catch (\Throwable $exception) {
if (!$this->checkExceptionExpectations($exception)) {
throw $exception;
}
I didn't understand the syntax in this line:
$testResult = $this->{$this->name}(...\array_values($testArguments));
Can anyone explain me what the previous line means, please?
I forgot to ask another thing: what does mean ...\ before array_values?