Пример #1
0
 public function __construct()
 {
     $this->attributes['cycles'] = '';
     $this->attributes['recurringCharge'] = '';
     $this->attributes['interval'] = '';
     $this->attributes['startsIn'] = null;
     parent::__construct();
 }
Пример #2
0
 public function testAddPricingElements()
 {
     $pricingSet = new PricingSet();
     $this->assertCount(1, $pricingSet->getPricingElements(), 'the elements should start with the total value element');
     $element1 = new PricingElement();
     $element1->setPosition(100);
     $pricingSet->addPricingElement($element1);
     $this->assertCount(2, $pricingSet->getPricingElements());
     $element2 = new PricingElement();
     $element2->setPosition(10);
     $pricingSet->addPricingElement($element2);
     $elements = $pricingSet->getPricingElements();
     $this->assertCount(3, $elements);
     $this->assertSame($element2, array_shift($elements), 'the second element should be first since the position is lower');
     $this->assertSame($element1, array_shift($elements), 'the first element should be next since the position is higher');
     $this->assertInstanceOf('ImmersiveLabs\\Pricing\\Entity\\Element\\TotalValueElement', array_shift($elements), 'the preset element should be last');
     $this->markTestIncomplete('deal with multiple elements with the same position');
 }