Пример #1
0
 public function testSaysDoctorName()
 {
     $whovian = new Whovian('David Tennant');
     $this->assertEquals('The best doctor is David Tennant', $whovian->say());
 }
Пример #2
0
 public function testSaysDoctorName()
 {
     $whovian = new Whovian("Yasin Yaqoobi");
     $this->assertEquals('The best doctor is Yasin Yaqoobi', $whovian->say());
 }
Пример #3
0
 public function testSaysDoctorName()
 {
     $whovian = new Whovian('데이비드 테넌트');
     $this->assertEquals('최고의 닥터는 바로 데이비드 테넌트', $whovian->say());
 }
Пример #4
0
 public function testSayDoctorName()
 {
     $whovian = new Whovian('Tomas Liu');
     $this->assertEquals('The best doctor is Tomas Liu', $whovian->say());
 }
 public function testSaysDoctorName()
 {
     $whovian = new Whovian("Peter Cabaldi");
     $this->assertEquals("Najlepszy doktor to Peter Cabaldi", $whovian->say());
 }
<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";
}