Run PHPUnit on composer projects

I am working on a lib for composer/packagist.

While working on the PHP classes,I am parallely writing the tests for the method, to check if everything works well.

file tree:

├── composer.json
├── composer.lock
├── README.md
├── src
│   └── Resizer.php
├── tests
│   └── ResizerTests.php
└── vendor
    └── PHPUnit etc...

composer.json:

{
    "name": "eschmid1972/image-resizer",
    "description": "Library for resizing images with custom options",
    "keywords": [
        "php",
        "image",
        "imagemagick",
        "resize"
    ],
    "license": "BSD-3"
    ],
    "require": {},
    "require-dev": {
        "phpunit/phpunit": "~4.0"
    }
}

What do I need to do, so I can run the tests with the command phpunit
in the project root?

I’ve found the solution: you need to create a phpunit.xml
file in the project root or the directory where you want to execute phpunit
.

The documentation for the configuration is hosted at:

https://phpunit.de/manual/current/en/appendixes.configuration.html

Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合编程 » Run PHPUnit on composer projects

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录