下面由phpstorm教程欄目給大家介紹phpstorm-laravel-phpunit,希望對需要的朋友有所幫助!
一,新建composer.json文件
{ "require": { "yzalis/identicon": "^1.1", "phpunit/phpunit": "5.5.*" } }
二,運(yùn)行composer install,得到如下目錄結(jié)構(gòu)
三,復(fù)制yzalis/phpuit.xml.dist
到項(xiàng)目的根目錄下,并重命名為phpunit.xml
四,配置phpstorm的php環(huán)境
五,配置PHPUnit環(huán)境
六,新建RunTest.php文件
<?php namespace demo1; use IdenticonIdenticon; use PHPUnitFrameworkTestCase; class RunTest extends TestCase{ public function testDemo(){ $identicon = new Identicon(); $img = $identicon->getImageData('bar',512); file_put_contents('./a.png',$img); } }
七,執(zhí)行
八,輸出