* ユニットテスト [#ced9cbb6]

以下のようにセットアップした後、lime_testのインスタンスを作り、テストを書いていく。

*** APP_ROOT/test/unit/fooTest.php : [#q9e94202]
 require_once dirname(__FILE__).'/../bootstrap/unit.php';
 // ==========================================================================
 // Setup
 // ==========================================================================
 $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
 new sfDatabaseManager($configuration);
 sfContext::createInstance($configuration);
 
 // ==========================================================================
 // Test
 // ==========================================================================
 $t = new lime_test(10);
 # 1
 $t->pass('This test always passes.');
 
 # 2
 ....

** sfContext::createInstance()が必要な理由について [#f2596071]
http://www.srcnix.com/2010/02/08/symfony-1-2-tasks-the-default-context-does-not-exist/

** 参考 [#u3a16e7b]
http://www.symfony-project.org/book/1_2/15-Unit-and-Functional-Testing


トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS