简体   繁体   中英

Phpstorm and Yii2 advanced template

I am using with . I have seen all Yii2 documents. Everything's fine. There's some questions about integrating Yii2 and PhpStorm (both are my favorites) that googling caused no good solution. Maybe many developers has same questions so that I want to ask here:


  1. I have installed globally with composer then have build and run all tests included in advanced template with codeception. 全局安装了 ,然后使用构建并运行了高级模板中包含的所有测试。 everything is OK. But when I want to write new (frontend, backend , ...) test in PhpStorm, there is no auto-complete for using codeception. Also when you open some existing default tests in PhpStorm such as SignupCest.php file, namespaces are undefined and PhpStorm cannot find referenced method in subject classes!

Any suggestion or solution?

updated

  1. Could anyone help with a complete tutorial on how to debug a yii2 project with Xdebug, PhpStorm and Chrome/Firefox? Although there are some tutorial on debugging pure Php projects/scripts but didn't find any on yii2.

In Settings in Language & Frameworks in PHP set Include path to codeception. Like this

For those Who want to know:

After that you included the codeception framework's path to your project you have to change PHPDoc Blocks for correct addressing of @param.

For example acceptance test

namespaces in SignupCest.php file:

From: @param \\codeception_frontend\\AcceptanceTester $I

To: @param AcceptanceTester $I

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM