Hi Dan,
Hope you're doing well.
I'm using Pest more and more and Pest tests look like this:
<?php
// tests/Feature/BrandsTest.php
test('brands', function () {
$response = $this->get('/brands');
$response->assertStatus(200);
});
$this in this context is not known to phpactor (neither to intelephense), which makes sense. But under the hood it's Tests\TestCase, thanks to this line:
// tests/Pest.php
uses(TestCase::class)->in('Feature');
For now I'm stuck with adding this docblock to each test:
<?php
test('brands', function () {
/** @var Tests\TestCase $this */
$response = $this->get('/brands');
$response->assertStatus(200);
});
I imagine it would be out of the scope of phpactor to parse the Pest file, but is there a way to tell phpactor (in a .phpactor.yml file for example) what $this refers to in a specific set of files (like in a whole folder)?
Thanks!
Edit: Found this related issue for Intelephense. I guess using the get function as stated in Pest doc is a good workaround to this problem.
Hi Dan,
Hope you're doing well.
I'm using Pest more and more and Pest tests look like this:
$thisin this context is not known to phpactor (neither to intelephense), which makes sense. But under the hood it'sTests\TestCase, thanks to this line:For now I'm stuck with adding this docblock to each test:
I imagine it would be out of the scope of phpactor to parse the Pest file, but is there a way to tell phpactor (in a
.phpactor.ymlfile for example) what$thisrefers to in a specific set of files (like in a whole folder)?Thanks!
Edit: Found this related issue for Intelephense. I guess using the
getfunction as stated in Pest doc is a good workaround to this problem.