承接 foogile/nb-remote-phpunit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

foogile/nb-remote-phpunit

最新稳定版本:v0.0.2

Composer 安装命令:

composer require foogile/nb-remote-phpunit

包简介

Execute PHPUnit tests over ssh using NetBeans

README 文档

README

Custom PHPUnit script that enables NetBeans to run tests on a remote host. Mainly developed to make Vagrant environments more convenient to work with, but it can easily be extended to communicate with other remote hosts.

Installation

The package should be installed using composer:

compose require foogile/nb-remote-phpunit

Subsequent sections desribe more specific installations.

Vagrant

Default Vagrant test scripts can be installed using the following commands:

vagrant ssh;
cd /vagrant
compose require foogile/nb-remote-phpunit

Other

See "Custom test runner".

Usage

Activate remote execution in NetBeans 8 as follows:

  1. Right click your project and click "Properties"
  2. Navigate to "Testing" > "PHPUnit"
  3. Check "Use Custom PHPUnit Script" and point "PHPUnit Script" to VAGRANT_PATH/vendor/foogile/nb-remote-phpunit/netbeans/phpunit-vagrant.php, where VAGRANT_PATH is an absolute path to your vagrant folder.
  4. Run tests as you would normally do

Custom test runner

You can run tests on custom remote hosts by implementing a custom remote host and providing a custom NetBeans PHPUnit script.

For example:

class SSHRemoteHost implements RemoteHostInterface
{
    public public put($localPath, $remotePath)
    {
        exec("scp $src myhost.com:$dst");
    }
    
    public function get($remotePath, $localpath)
    {
        exec("scp myhost.com:$remotePath $localPath");
    }

    public function delete($remotePath)
    {
        exec("ssh myhost.com 'rm $remotePath'");
    }

    public function exec($command)
    {
        exec("ssh myhost.com '$command'");
    }

See netbeans/phpunit-vagrant.php for an example of a custom NetBeans PHPUnit script.

Pull requests are welcome :)

Credits

Based on the blog post Running PHPUnit tests on a VM, from NetBeans.

统计信息

  • 总下载量: 90
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2015-04-19