ユニットテスト以下のようにセットアップした後、lime_testのインスタンスを作り、テストを書いていく。 APP_ROOT/test/unit/fooTest.php : 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/ 参考http://www.symfony-project.org/book/1_2/15-Unit-and-Functional-Testing |
|