Пример #1
0
 function test_getName()
 {
     //Arrange
     $name = "Departure";
     $cuisine_id = 1;
     $id = 1;
     $rating = 3;
     $address = "1139 NW Elm Street";
     $description = "Yum yum for my tum tum";
     $test_Venue = new Venue($name, $cuisine_id, $id, $rating, $address, $description);
     //Act
     $result = $test_Venue->getName();
     //Assert
     $this->assertEquals($name, $result);
 }
Пример #2
0
<?php

namespace woo\domain;

class Venue
{
    private $id;
    private $name;
    function __construct($id, $name)
    {
        $this->name = $name;
        $this->id = $id;
    }
    function getName()
    {
        return $this->name;
    }
    function getId()
    {
        return $this->id;
    }
}
$x = new Venue(null, 'bob');
$x = new Venue(55, 'bob');
print $x->getName();
print $x->getId();