本文整理汇总了PHP中Address::getState方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::getState方法的具体用法?PHP Address::getState怎么用?PHP Address::getState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::getState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettersShouldReturnTheAttributeValue
/**
* @test
*/
public function gettersShouldReturnTheAttributeValue()
{
$this->assertAttributeEquals($this->address->getCountry(), 'country', $this->address);
$this->assertAttributeEquals($this->address->getState(), 'state', $this->address);
$this->assertAttributeEquals($this->address->getCity(), 'city', $this->address);
$this->assertAttributeEquals($this->address->getPostalCode(), 'postalCode', $this->address);
$this->assertAttributeEquals($this->address->getDistrict(), 'district', $this->address);
$this->assertAttributeEquals($this->address->getStreet(), 'street', $this->address);
$this->assertAttributeEquals($this->address->getNumber(), 'number', $this->address);
$this->assertAttributeEquals($this->address->getComplement(), 'complement', $this->address);
}
示例2: testValidaState
public function testValidaState()
{
$state = 'SP';
$address = new Address();
$address->setState($state);
$this->assertEquals($state, $address->getState());
}
示例3: calculateTax
public static function calculateTax($taxClass, $productPrice, $address)
{
if (!$address) {
$address = new Address();
}
$country = $address->getCountry();
$province = $address->getState();
$sql = 'select `tax_rate` from ecomm_tax_rate where country = "' . e($country) . '" AND
province = "' . e($province) . '" AND
tax_class = "' . e($taxClass) . '"';
$result = Database::singleton()->query_fetch($sql);
$taxRate = $result['tax_rate'];
if (!$taxRate) {
$taxRate = 0;
}
$taxRate = $taxRate / 100;
return (double) $taxRate * (double) $productPrice;
}
示例4: testSetState
/**
* @todo Implement testSetState().
*/
public function testSetState()
{
$this->object->setState(8);
$this->assertEquals($this->object->getState(), 8);
}
示例5: encodeAddress
public function encodeAddress(Address $address)
{
return ['street' => $address->getStreet(), 'street2' => $address->getStreet2(), 'zip' => $address->getZip(), 'city' => $address->getCity(), 'country' => $address->getCountry(), 'state' => $address->getState(), 'email' => $address->getEmail(), 'tel' => $address->getTel(), 'fax' => $address->getZip()];
}
示例6: testSetStateWorks
public function testSetStateWorks()
{
$address = new Address();
$address->setState('RS');
$this->assertEquals('RS', $address->getState());
}