目前我的系统安装phpunit是在4.3.1上
做phpunit --self-update会更新到目前最新版本的phpunit 5.3。*。
我想将其更新为特定版本(4.8.24)
我怎么想这样做?
注意:我知道composer选项,但我想在我的系统上安装phpunit。
Currently my system installed phpunit is on 4.3.1
Doing phpunit --self-update will update to the latest version of phpunit which is 5.3.* at the moment.
I like to update it to a specific version (4.8.24)
How am I suppose to do this?
Note: I know about the composer option, but I would like to do it on my system installed phpunit.
最满意答案
我最终更改了/usr/local/share/phpunit/文件夹中的/usr/local/share/phpunit/文件
这个开发环境是通过这个http://vccw.cc/设置的,它安装了phpunit 4.3.1,我需要4.8.24因为我正在做wordpress插件单元测试http://wp-cli.org/docs/插件单元测试/它说4.8。*是必需的。
所以这就是我所做的。
下载最新的4.8。*版phpunit https://phpunit.de/ 将phar文件重命名为phpunit.phar(我删除版本部分) 执行此chmod +x phpunit.phar以使phar文件可执行 将phpunit.phar复制到/usr/local/share/phpunit/文件夹注意:我删除旧的phpunit.phar(即4.3.1)并替换为这个新的
它们已经是/usr/local/bin/phpunit上的符号链接,用于vccw设置的/usr/local/share/phpunit/phpunit.phar。
我认为改变phpunit版本也可以通过修改vccw提供的配置文件来完成,但我不是那样配置脚本,只有基本知识。
我希望这有助于其他开发人员,特别是像我这样的Windows开发人员在基于unix的开发环境中工作。
PS。 这个dev env仅供我使用,它不受版本控制,所以如果我直接更改dev env(不是通过vccw提供的配置脚本),它对我来说没问题
I ended up changing the phpunit.phar file on my /usr/local/share/phpunit/ folder
This dev environment is set up via this http://vccw.cc/ and it installs phpunit 4.3.1, I need 4.8.24 coz I'm doing wordpress plugin unit testing http://wp-cli.org/docs/plugin-unit-tests/ it says there 4.8.* is required.
So here is what I did.
Download latest 4.8.* version of phpunit here https://phpunit.de/ Rename the phar file to phpunit.phar ( I remove the version section ) Execute this chmod +x phpunit.phar to make the phar file executable Copy the phpunit.phar to /usr/local/share/phpunit/ folderNote: I remove the old phpunit.phar ( that is the 4.3.1 ) and replace with this new one
Also their is already a symbolic link on /usr/local/bin/phpunit for /usr/local/share/phpunit/phpunit.phar setup by vccw.
I think changing phpunit version can be done too via modifying the provisioning files provided by vccw but I'm not that in to provisioning scripts, only basic knowledge.
I hope this helps other devs, specially windows devs like me working on unix based dev env.
PS. This dev env is only used by me, it isn't version controlled so its ok for me if I make changes to the dev env directly ( not via provisioning scripts provided by vccw )
更多推荐
发布评论