lang
1<?php 2require_once('FacadeCommentLogicDi.php'); 3 4class FacadeCommentLogicDiTest extends PHPUnit_Framework_TestCase{ 5 6 public function testDosomething() 7 { 8 $bar = new FacadeCommentLogicDi(); 9 $bar->insertIntroComment('hoge'); 10 $this->assertequals(true,true); 11 } 12] 13
lang
1<?php 2 3require_once('FacadeIntroCommentTable.php'); 4 5interface FacadeCommentLogicDiInterface 6{ 7 public function insertIntroComment($posted_com); 8} 9 10 11 12class FacadeCommentLogicDi implements FacadeCommentLogicDiInterface{ 13 14 protected $facadeintable; 15 16 public function __construct(FacadeIntroCommentTable $facadeintable){ 17 $this->facadeintable = $facadeintable; 18 19 } 20 21 public function insertIntroComment($posted_com){ 22 $this->facadeintable->insert($posted_com); 23 24 25 } 26} 27
これで、phpunit FacadeCommentLogicDiTest.phpを実行すると、
There was 1 error:
- FacadeCommentLogicDiTest::testDosomething
Argument 1 passed to FacadeCommentLogicDi::__construct() m> ust be an instance of FacadeIntroCommentTable, none give> n, called in /var/www/html/board/Class/FacadeCommentLogicDiTest.php on line 13 and defined
/var/www/html/board/Class/FacadeCommentLogicDi.php:17
/var/www/html/board/Class/FacadeCommentLogicDiTest.php:13
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
となります。エラーの消し方を教えてください。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/06/12 00:28