2013-06-19 37 views
1

我正在使用'sfJwtPhpUnitPlugin'插件来测试我的symfony 1.4项目。我遵循以下步骤。PHPUnitTest没有给出symfony 1.4的结果

安装:https://github.com/JWT-OSS/sfJwtPhpUnitPlugin/blob/1.0.3/INSTALL.md 用法:https://github.com/JWT-OSS/sfJwtPhpUnitPlugin/blob/1.0.3/USAGE.md

自动生成我的测试用例。

当我火命令./symfony phpunit:unit我看不到任何结果..

..据导游介绍,我可以看到下面的语句

When running PHPUnit Symfony tasks, JPUP will look for and execute the bootstrap file in sf_test_dir/bootstrap/phpunit.php. If you have any code that needs to be executed before any tests are run, put it in this bootstrap file. 

但我不能看到一个文件phpunit.php内部测试/引导目录。我该如何解决这个问题?

回答

1

您可以复制test/bootstrap/unit.php并删除包含石灰的生产线。例如我的引导文件

<?php 

// configuration 
require_once __DIR__ . '/../../config/ProjectConfiguration.class.php'; 
$configuration = ProjectConfiguration::hasActive() ? ProjectConfiguration::getActive() : new ProjectConfiguration(); 

// autoloader 
$autoload = sfSimpleAutoload::getInstance(sfConfig::get('sf_cache_dir').'/project_autoload.cache'); 
$autoload->loadConfiguration(
    sfFinder::type('file')->name('autoload.yml')->in(
     array(
      sfConfig::get('sf_symfony_lib_dir') . '/config/config', 
      sfConfig::get('sf_config_dir'), 
     ) 
    ) 
); 
$autoload->register();