本文整理汇总了PHP中Car::getBrand方法的典型用法代码示例。如果您正苦于以下问题:PHP Car::getBrand方法的具体用法?PHP Car::getBrand怎么用?PHP Car::getBrand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Car
的用法示例。
在下文中一共展示了Car::getBrand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shouldBeAbleToPopulateByJSON
/**
* @test
*/
public function shouldBeAbleToPopulateByJSON()
{
// given
$car = new Car(1);
$this->assertEquals(1, $car->getId());
$json = $car;
$array = json_decode($json, true);
// when
$array['brand'] = 'BMW';
$car->setValues($array);
$car->commit();
$newCar = new Car(1);
// then
$this->assertEquals('BMW', $newCar->getBrand());
}
示例2: __construct
include "Vehicle.php";
class Car extends Vehicle
{
private $noOfDoors;
private $color;
private $brand;
public function __construct($cc, $hp, $noOfDoors, $color, $brand)
{
echo "<br/>Hi from car constructor";
parent::__construct('Car', $cc, $hp);
$this->noOfDoors = $noOfDoors;
$this->color = $color;
$this->brand = $brand;
}
public function getColor()
{
return $this->color;
}
public function getNoOfDoors()
{
return $this->noOfDoors;
}
public function getBrand()
{
return $this->brand;
}
}
$v = new Car(1.3, 100, 4, 'Golden', 'BMW');
echo "<br/>Type is " . $v->getType() . ", CC : " . $v->getCc() . ", HP : " . $v->getHp() . ", Color : " . $v->getColor() . ", Brand : " . $v->getBrand();
示例3: shouldBeAbleToDefineDefaultData
/**
* @test
*/
public function shouldBeAbleToDefineDefaultData()
{
// given
$car = new Car();
$car->drop()->yesImSure();
$car->createTable();
new Car();
$db = LudoDB::getInstance();
$row = $db->one("select count(id) as num from car");
// then
$this->assertEquals(7, $row['num']);
$car = new Car(1);
$this->assertEquals('Opel', $car->getBrand());
}