当前位置: 首页 > 工具软件 > phpunit-vw > 使用案例 >

安装PHPUnit及简单的测试

卢开济
2023-12-01

Windows上安装 PHPUnit

PHPUnit安装分为两种,一种是全局安装,一种是Composer安装,下面分别介绍两种安装方法

全局安装

  1. 为 PHP 的二进制可执行文件建立一个目录,例如 D:\tools\php\phpunit
  2. 将 ;D:\tools\php\phpunit 附加到 PATH 环境变量中
  3. 下载 https://phar.phpunit.de/phpunit-8.5.phar 并将文件保存到 D:\tools\php\phpunit\phpunit.phar
  4. 打开命令行(例如,按 Windows+R » 输入 cmd » ENTER)
  5. 建立外包覆批处理脚本(最后得到 D:\tools\php\phpunit\phpunit.cmd):
C:\Users\username> cd D:\tools\php\phpunit
C:\Users\username> d:
D:\tools\php\phpunit> echo @
 类似资料: