1. Create a new composer.json file
{
"require": {
"yzalis/identicon": "^1.1",
"phpunit/phpunit": "5.5.*"
}
}
2. Run composer install to get the following directory structure
![1642817044616561.png One article to complete the configuration of phpstorm+laravel+phpunit](https://img.php.cn/upload/image/411/112/298/1642817044616561.png)
Third, copy yzalis/phpuit.xml.dist
to the root directory of the project and rename it to phpunit.xml
Four, configure the php environment of phpstorm
![1642817048510884.png One article to complete the configuration of phpstorm+laravel+phpunit](https://img.php.cn/upload/image/222/906/405/1642817048510884.png)
Five, configure the PHPUnit environment
![1642817052907942.png One article to complete the configuration of phpstorm+laravel+phpunit](https://img.php.cn/upload/image/817/228/774/1642817052907942.png)
Six, Create a new RunTest.php file
<?php namespace demo1;
use Identicon\Identicon;
use PHPUnit\Framework\TestCase;
class RunTest extends TestCase{
public function testDemo(){
$identicon = new Identicon();
$img = $identicon->getImageData('bar',512);
file_put_contents('./a.png',$img);
}
}
7, execute
![1642817057101625.png One article to complete the configuration of phpstorm+laravel+phpunit](https://img.php.cn/upload/image/599/761/323/1642817057101625.png)
##8, output
![1642817062666860.png One article to complete the configuration of phpstorm+laravel+phpunit](https://img.php.cn/upload/image/321/153/279/1642817062666860.png)
The above is the detailed content of One article to complete the configuration of phpstorm+laravel+phpunit. For more information, please follow other related articles on the PHP Chinese website!