{ "require": { "yzalis/identicon": "^1.1", "phpunit/phpunit": "5.5.*" } }
yzalis/phpuit.xml.dist
到項目的根目錄下,並重命名爲phpunit.xml
<?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); } }