実行環境
Joomla 3.6
PHP 5.5(Xampp)
PHPUnit 4.7
Windows 10
lang
1class ArticleTest extends \PHPUnit_Framework_TestCase 2{ 3 protected function setUp() 4 { 5 $app = JFactory::getApplication('administrator'); 6 $session = JFactory::getSession(); 7 $session->set('user', JUser::getInstance('admin')); 8 JFactory::getApplication()->input->post->set(JSession::getFormToken(), 1); 9 } 10 11 public function testListArticles() 12 { 13 $c = new ContentController(); 14 $model = $c->getModel('articles'); 15 $articles = $model->getItems(); 16 $this->assertNotEmpty($articles); 17 18 $a = 10; 19 $this->assertEquals('10', $a); 20 $this->assertEquals('11', $a); 21 $this->assertEquals('12', $a); 22 } 23}
http://www.aldoapp.com/tutorials/10-how-to-do-test-driven-develoment-for-joomla-component
上記URLを参考にユニットテストを作成し、テストを実行したところ、
エラーメッセージもテスト完了メッセージも表示されないため、どこが悪いのかが
わからない状態です。
上記のような場合、どのような設定をすればJoomlaのユニットテストができるように
なるのでしょうか。
あなたの回答
tips
プレビュー