/** * @expectedException \InvalidArgumentException */ public function testGetItemByNotExistingCode() { $adjustments = ['adj1']; $collection = new Collection($this->adjustmentPool, $adjustments); $collection->getItemByCode('not_existing_code'); }
/** * @covers \Magento\Framework\Pricing\PriceInfo\Base::getAdjustment */ public function testGetAdjustment() { $this->adjustmentCollection->expects($this->any())->method('getItemByCode')->with('test1')->will($this->returnValue('adjustment')); $this->assertEquals('adjustment', $this->model->getAdjustment('test1')); }
/** * Get adjustment by code * * @param string $adjustmentCode * @throws \InvalidArgumentException * @return AdjustmentInterface */ public function getAdjustment($adjustmentCode) { return $this->adjustmentCollection->getItemByCode($adjustmentCode); }