- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- PHP-symfony/ユニットテスト へ行く。
- 1 (2011-09-01 (木) 14:23:36)
- 2 (2011-09-01 (木) 14:25:24)
ユニットテスト
以下のようにセットアップした後、lime_testのインスタンスを作り、テストを書いていく。
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()が必要な理由について
http://www.srcnix.com/2010/02/08/symfony-1-2-tasks-the-default-context-does-not-exist/