/** * @expectedException Exception */ public function testRespondToInDisagreement() { $whovian = new Whovian('David Tennant'); $opinion = 'No way. Matt Smith was awesome!'; $whovian->respondTo($opinion); }
/** * @expectedException Exception */ public function testRespondToInDisagreement() { $whovian = new Whovian('Yasin Yaqoobi'); $opinion = 'No way. Math Smith was awesome'; $whovian->respondTo($opinion); }
/** * @expectedException Exception */ public function testRespondToInDisagreement() { $whovian = new Whovian('데이비드 테넌트'); $opinion = '아냐. 맷 스미스가 끝내주지!'; $whovian->respondTo($opinion); }
/** * @expectedException Exception */ public function testRespontToInDisagreement() { $whovian = new Whovian('Tomas Liu'); $opinion = 'I think Mattias Smith was awesome!'; $whovian->respondTo($opinion); }
/** * @expectedException Exception */ public function testRespondToInDisagreement() { $whovian = new Whovian("David Tennant"); $opinion = "Najlepszy doktor to Peter Cabaldi"; $whovian->respondTo($opinion); }
<meta charset="UTF-8"> <?php require_once 'src/Whovian.php'; $cabaldiFan1 = new Whovian("Peter Cabaldi"); echo $cabaldiFan1->say() . ".<br/>\n"; $cabaldiFan2 = new Whovian("Peter Cabaldi"); echo $cabaldiFan2->say() . ".<br/>\n"; $tennantFan1 = new Whovian("David Tennant"); echo $tennantFan1->say() . ".<br/>\n"; //var_dump($cabaldiFan1); try { echo $cabaldiFan2->respondTo($cabaldiFan1->say()) . "<br/>\n"; echo $cabaldiFan2->respondTo($tennantFan1->say()) . "<br/>\n"; } catch (Exception $e) { echo "Wyjątek: " . $e->getMessage() . "<br/>\n"; }