1. Create a new composer.json file
{ "require": { "yzalis/identicon": "^1.1", "phpunit/phpunit": "5.5.*" } }
Copy after login
2. Run composer install to get the following directory structure
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
Five, configure the PHPUnit environment
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); } }
Copy after login