You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 20, 2023. It is now read-only.
interface QueryContextInterface
{
/**
* Get the query tree builder.
*
* @return TreeBuilder
*/
public function getTreeBuilder();
}
RepresentAggsAsFacets
interface RepresentAggsAsFacets
{
/**
* @return string[]
*/
public function getAggregationKeys(): array;
}
Now, when I execute the test, I get the following error message:
PHP Fatal error: Declaration of Mock_RepresentAggsAsFacets_2fec4bca::getAggregationKeys() must be compatible with Jobcloud\PlatformBundle\Elasticsearch\RepresentAggsAsFacets::getAggregationKeys(): array in /srv/httpd/unity-backend-core/PlatformBundle/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php(340) : eval()'d code on line 11
The error does not show if I remove the typehint of RepresentAggsAsFacets::getAggregationKeys.
<?phpinterface A
{
publicfunctionfoo(): A;
}
interface B
{
}
class Test extendsPHPUnit\Framework\TestCase
{
publicfunctiontestOne()
{
$this->createMock([A::class, B::class]);
}
}
I need to create a mock of a class that implements two interfaces. This is what I do:
QueryContextInterface:
RepresentAggsAsFacets
Now, when I execute the test, I get the following error message:
PHP Fatal error: Declaration of Mock_RepresentAggsAsFacets_2fec4bca::getAggregationKeys() must be compatible with Jobcloud\PlatformBundle\Elasticsearch\RepresentAggsAsFacets::getAggregationKeys(): array in /srv/httpd/unity-backend-core/PlatformBundle/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php(340) : eval()'d code on line 11
The error does not show if I remove the typehint of RepresentAggsAsFacets::getAggregationKeys.
PHP-Version: 7.0.9
PHPUnit: 5.5
phpunit-mock-objects: 3.1
The text was updated successfully, but these errors were encountered: