atoum/sfatoumplugin

本软件包最新版本(dev-master)没有提供许可证信息。

安装数: 2,695

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 7

类型:symfony1-plugin

dev-master 2012-11-30 08:32 UTC

This package is auto-updated.

Last update: 2020-01-05 16:16:54 UTC


README

##安装

使用Composer

将以下内容添加到您的composer.json依赖中(示例

  "require"     : {
    "atoum/sfAtoumPlugin": "*"
  },

运行

php composer.phar update

插件应在插件文件夹中,而atoum应在vendor文件夹中。

然后在您的ProjectConfiguration文件中激活插件并定义atoum路径。

  sfConfig::set('sf_atoum_path', dirname(__FILE__) . '/../vendor/atoum/atoum');

  if (sfConfig::get('sf_environment') != 'prod')
  {
    $this->enablePlugins('sfAtoumPlugin');
  }

使用Git子模块

安装atoum作为子模块

git submodule add git://github.com/atoum/atoum.git lib/vendor/atoum

安装sfAtoumPlugin作为子模块

git submodule add git://github.com/agallou/sfAtoumPlugin.git plugins/sfAtoumPlugin

在ProjectConfiguration文件中添加插件


  if (sfConfig::get('sf_environment') != 'prod')
  {
    $this->enablePlugins('sfAtoumPlugin');
  }

##启动测试

php symfony atoum:test

您可以通过-c选项传递配置文件(有关如何编写配置文件的说明,请参阅这里

php symfony atoum:test -c config/atoum/hudson.php

所有atoum选项都是可用的

 ./symfony help atoum:test

Usage:
 symfony atoum:test [-p|--php[="..."]] [--default-report-title[="..."]] [-c|--configurations[="..."]] [--score-file[="..."]] [--max-children-number[="..."]] [--no-code-coverage] [--no-code-coverage-in-directories[="..."]] [--no-code-coverage-for-namespaces[="..."]] [--no-code-coverage-for-classes[="..."]] [-f|--files[="..."]] [-d|--directories[="..."]] [--test-file-extensions[="..."]] [-g|--glob[="..."]] [--tags[="..."]] [-m|--methods[="..."]] [--namespaces[="..."]] [-l|--loop] [--test-it[="..."]] [--test-all[="..."]] [--force-terminal[="..."]] [--bootstrap-file[="..."]] [--use-light-report[="..."]] [--debug[="..."]]

Arguments:
 test-file-or-dir        path to test files or folders

Options:
 --php                              (-p) Path to PHP binary which must be used to run tests (default: Array(    [0] => /usr/bin/php5)) (multiple values allowed)
 --default-report-title             Define default report title with <string> (multiple values allowed)
 --configurations                   (-c) Use all configuration files <file> (multiple values allowed)
 --score-file                       Save score in file <file> (multiple values allowed)
 --max-children-number              Maximum number of sub-processus which will be run simultaneously (multiple values allowed)
 --no-code-coverage                 Disable code coverage
 --no-code-coverage-in-directories  Disable code coverage in directories <directory> (multiple values allowed)
 --no-code-coverage-for-namespaces  Disable code coverage for namespaces <namespace> (multiple values allowed)
 --no-code-coverage-for-classes     Disable code coverage for classes <class> (multiple values allowed)
 --files                            (-f) Execute all unit test files <file> (multiple values allowed)
 --directories                      (-d) Execute unit test files in all <directory> (default: Array(    [0] => /var/www/ereservation/test/unit/)) (multiple values allowed)
 --test-file-extensions             Execute unit test files with one of extensions <extension> (multiple values allowed)
 --glob                             (-g) Execute unit test files which match <pattern> (multiple values allowed)
 --tags                             Execute only unit test with tags <tag> (multiple values allowed)
 --methods                          (-m) Execute all <class::method>, * may be used as wildcard for class name or method name (multiple values allowed)
 --namespaces                       Execute all classes in all namespaces <namespace> (multiple values allowed)
 --loop                             (-l) Execute tests in an infinite loop
 --test-it                          Execute atoum unit tests (multiple values allowed)
 --test-all                         Execute unit tests in directories defined via $script->addTestAllDirectory('path/to/directory') in a configuration file (multiple values allowed)
 --force-terminal                   Force output as in terminal (multiple values allowed)
 --bootstrap-file                   Include <file> before executing each test method (multiple values allowed)
 --use-light-report                 Use "light" CLI report (multiple values allowed)
 --debug                            Enable debug mode (multiple values allowed)

##编写测试

测试必须包含引导程序

require_once __DIR__ . '/../../../../plugins/sfAtoumPlugin/bootstrap/unit.php';

##Atoum

Atoum仓库和文档可在以下位置找到

https://github.com/atoum/atoum