一,新建composer.json文件
{
"require": {
"yzalis/identicon": "^1.1",
"phpunit/phpunit": "5.5.*"
}
}登录后复制
二,运行composer install,得到如下目录结构

三,复制yzalis/phpuit.xml.dist到项目的根目录下,并重命名为phpunit.xml
四,配置phpstorm的php环境

五,配置PHPUnit环境

六,新建RunTest.php文件
<?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);
}
}登录后复制
七,执行

立即学习“PHP免费学习笔记(深入)”;
八,输出



