-
-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing PHPStorm plugin #5
Comments
This has also implications on the For example: <?php
beforeEach(function () {
/* @var \Tests\TestCase $this */
$this->fooMock = Mockery::mock(Foo::class);
$this->fooMock->shouldReceive('execute')->andReturnTrue();
});
it('recognises dynamic properties', function () {
/* @var \Tests\TestCase $this */
$this->fooMock->expects('foo'); // No autocomplete on fooMock
}); Currently I can't seem to find a workaround for this. |
I got in touch with PHPStorm team. They told me this is something that can be accomplished doing a plugin. We just need to find someone with the expertises to do it. I guess is just a question of having Pest open sourced. 👍 |
A workaround which could make this work without an IDE, would be to supply the class as the first argument in the function. it('foo', function (TestCase $test) {
$test->assertFoo;
});
|
I can look into creating a Pest plugin for PHPStorm. Need a bit of a refresher first, I last worked on an intelliJ plugin a while ago. This will most probably be a "Custom Language Support" plugin, but a "Framework Integration" plugin might allow for more functionality in future. |
@tbtmuse That would be awesome. The PHPStorm core team told me that we should take a look into this: https://github.com/Haehnchen/idea-php-symfony2-plugin for grabbing some ideas. |
Perfect thanks. |
@nunomaduro Any reason to not do what @olivernybroe suggested? |
I don't know if it's relevant to this issue exactly, but the biggest thing preventing me adopting pest is the PHPStorm integration with the test runner. I've no idea how it works, sorry, but I know they support PHPUnit, PhpSpec and Behat and I think Codeception. This would be super useful for PHPStorm users! ❤️ |
Concerning autocompletions, the problem will be addressed in Pest 0.2. |
I got a little bit further using PEST a few days ago to run tests in phpstorm. It's a bit ugly. But unfortunately I had to give up as PHPStorm just doesn't seem ready yet for Pest. |
@petemcfarlane @jonnywilliamson
Then run your tests... # run a single file
./vendor/bin/pest --filter RegisterTest
# run a specific test (pretty cool this works!)
./vendor/bin/pest --filter 'requires a password to be at least 8 characters' And if you want to make it shorter, create the following aliases. I have these in my
If anyone wants to help out, I opened an issue so we can get the cli documented with examples; just been so busy lately! |
Hey people, just tried out the package and I really enjoy writing tests like that. (I didn't thought I would hehe) For me missing right now is also more support for PhpStorm before I would integrate it in my daily workflow. Like @petemcfarlane said, being able to use PhpStorm's Test Runner would be awesome. I'm really used to go into a test and use a shortcut to run the current test, where my cursor is, or all tests of the current file. Not sure if this would be possible with a plugin? That's just my first feedback regarding PEST and PhpStorm. Again thanks for the package 👍 |
Has anybody looked into this yet? I think it makes sense to register pest as a new framework type, to have full control instead of trying to build on top of phpunit. At least my limited experience with plugin creation, says that building on top of the build in types often gives problems because there will be a lot of deprecations in future versions of phpstorm. |
So I can see we never updated this issue, there is a repository for the plugin and with a lot of working features. https://github.com/pestphp/pest-intellij @christophrumpel what you are asking for is possible in the plugin now btw. |
The IDE completion in PHPStorm can be better on closure based tests.
Problem: The
$this
variable inside closures don't get autocompletion on PHPStorm by default.Workaround: Add a type hint just before the
$this
variable.Solution: Develop a phpstorm-plugin that can hint phpstorm about this.
The text was updated successfully, but these errors were encountered: