matthiasnoback/php-coding-dojo
Composer 安装命令:
composer create-project matthiasnoback/php-coding-dojo
包简介
Empty project which can be used in a PHP and PHPUnit-oriented coding dojo
README 文档
README
Setup
To install the project:
php composer.phar create-project matthiasnoback/php-coding-dojo [path] *
You will have an empty src/ directory and a phpunit.xml.dist that is configured to run all the PHPUnit tests
names *Test.php in the directories src/*/Tests (and their subdirectories). When you use this configuration the
Composer autoloader will be initialized automatically to make sure that every namespaced class inside src/ can be
auto-loaded from within the test cases.
Configure PHPStorm to run the tests
- Choose
Run,Edit configurations...and remove any existing configuration. - Select
Defaults - PHPUnit, put a check beforeUse alternative configuration fileand selectphpunit.xml.distfrom this project. - Click the button to the right of this field. In the dialog that appears select
Use custom loaderand select the filevendor/autoload.phpinside your project. This will make sure PHPStorm uses the bundled version of PHPUnit.
To validate your setup once you have installed this project, run the tests: right-click on the src/ directory and
then select Run 'src'.
Run the unit tests
To run all tests in a testcase press Ctrl + Shift + F10 when the cursor is not inside a method.
To run one test press Ctrl + Shift + F10 when the cursor is inside a method.
To repeat the previous test run press Shift + F10.
Or you can run the tests from the command-line:
php vendor/bin/phpunit
When you first run the tests, PHPStorm might ask you to supply a PHP interpreter.
PHPUnit cheatsheet
You can use my PHPUnit cheatsheet as a quick reference for PHPUnit usage.
统计信息
- 总下载量: 117
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-01-29