2013-06-19 84 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();