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
<?phpnamespaceMyVendor\MyProject\Tests\_generated;
// This class was automatically generated by build task// You should not change it manually as it will be overwritten on next build// @codingStandardsIgnoreFiletraitUnitTesterActions
{
/** * [!] Method is generated. Documentation taken from corresponding module. * * Asserts that an array has a specified key. * * @param int|string $key * @param array|ArrayAccess $array * @see \Codeception\Module\AbstractAsserts::assertArrayHasKey() */publicfunctionassertArrayHasKey($key, $array, string$message = "") {
return$this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
}
}
☝️ it is still relative.
Using the ::assertArrayHasKey() trough the tester: $this->tester->assertArrayHasKey('foo', $myArrayOrArrayAccess);
PHPStorm highlights this line with an error, because:
Expected parameter of type 'array|\MyVendor\MyProject\Tests\_generated\ArrayAccess', '\MyVendor\MyProject\Foo' provided.
Recommended soulution
Use Fully Qualified Names for classes, traits and interfaces in PHPDoc type hints.
The text was updated successfully, but these errors were encountered:
Sweetchuck
added a commit
to Sweetchuck/codeception-lib-asserts
that referenced
this issue
Feb 17, 2022
Currently relative class names are used in PHPDoc type hints.
https://github.com/Codeception/lib-asserts/blob/master/src/Codeception/Util/Shared/InheritedAsserts.php#L5-25
When it is used it becomes like this:
☝️ it is still relative.
Using the
::assertArrayHasKey()
trough the tester:$this->tester->assertArrayHasKey('foo', $myArrayOrArrayAccess);
PHPStorm highlights this line with an error, because:
Recommended soulution
Use Fully Qualified Names for classes, traits and interfaces in PHPDoc type hints.
The text was updated successfully, but these errors were encountered: