Esempio n. 1
0
 /**
  * @covers Jam_Price::is
  * @expectedException Kohana_Exception
  */
 public function test_is_unknow_operator()
 {
     $monetary = new OpenBuildings\Monetary\Monetary('GBP', new OpenBuildings\Monetary\Source_Static());
     $price1 = new Jam_Price(10.2, 'GBP', $monetary);
     $price2 = new Jam_Price(11.5, 'EUR', $monetary);
     $this->assertTrue($price1->is('something', $price1));
 }
Esempio n. 2
0
 /**
  * Return TRUE if total is bigger than discount_threshold
  * @return boolean
  */
 public function is_discounted(Jam_Price $total)
 {
     return $this->discount_threshold and $total->is(Jam_Price::GREATER_THAN, $this->discount_threshold);
 }