Пример #1
0
 /**
  * @covers ::__constructor
  */
 public function testInitialState()
 {
     $item = new OrderItem();
     $this->assertCount(0, $item->getChildren(), 'OrderItem is not initialized with an empty child collection.');
     $this->assertCount(0, $item->getAdjustments(), 'OrderItem is not initialized with an empty adjustment collection.');
     $this->assertNull($item->getNetPrice(), 'OrderItem is not initialized with a null net price');
     $this->assertNull($item->getTaxName(), 'OrderItem is not initialized with a null tax name');
     $this->assertNull($item->getTaxRate(), 'OrderItem is not initialized with a null tax rate');
     $this->assertNull($item->getWeight(), 'OrderItem is not initialized with a null weight');
     $this->assertEquals(1, $item->getQuantity(), 'OrderItem is not initialized with a quantity that equals 1');
     $this->assertEquals(0, $item->getPosition(), 'OrderItem is not initialized with a position that equals 0');
 }
Пример #2
0
 private function getTestItemTwo()
 {
     $item = new OrderItem();
     $item->setDesignation('Test order item 2')->setReference('TEST-ITEM-2')->setTaxName('Tax 2');
     return $item;
 }