return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>testing - How can I enable IDE integration (autocomplete) for WordPress test suite
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

testing - How can I enable IDE integration (autocomplete) for WordPress test suite

programmeradmin0浏览0评论

When testing a theme or plugin, you can use WP-CLI to scaffold the test suite setup, wp scaffold plugin-test plugin.

So is there a good way to integrate an editor/IDE (VS Code in my case) so that autocompletion (method signatures, etc) works within the tests? Since the test library is installed in /tmp/ the editor is not indexing those files and thus thinks classes and functions are missing.

When testing a theme or plugin, you can use WP-CLI to scaffold the test suite setup, wp scaffold plugin-test plugin.

So is there a good way to integrate an editor/IDE (VS Code in my case) so that autocompletion (method signatures, etc) works within the tests? Since the test library is installed in /tmp/ the editor is not indexing those files and thus thinks classes and functions are missing.

Share Improve this question asked Sep 25, 2020 at 20:21 CoreyCorey 1821 silver badge6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

In order of preference:

  1. composer require wp-phpunit/wp-phpunit --dev. Depending on the IDE you use you might need to mark the package in vendor/ as a source directory.
  2. Each IDE allows you to add definitions from external libraries. In PHPStorm it's Settings → Languages & Frameworks → PHP → Include Path.
  3. Just copy the files over to some directory in your project and exclude them with .gitignore (if you use Git for version control).
发布评论

评论列表(0)

  1. 暂无评论