Example #1
0
 /**
  * @param $entryParams
  * @param $createCount
  * @dataProvider providerGetPrice
  */
 public function testGetPrice($entryParams, $createCount)
 {
     $priceCode = current(array_values(reset($entryParams)));
     $this->priceCollection->expects($this->exactly($createCount))->method('get')->with($this->equalTo($priceCode))->will($this->returnValue('basePrice'));
     foreach ($entryParams as $params) {
         list($priceCode) = array_values($params);
         $this->assertEquals('basePrice', $this->model->getPrice($priceCode));
     }
 }
 /**
  * Test current method
  */
 public function testCurrent()
 {
     $this->factoryMock->expects($this->once())->method('create')->with($this->equalTo($this->saleableItemMock), $this->equalTo($this->pool->current()), $this->quantity)->will($this->returnValue($this->priceMock));
     $this->assertEquals($this->priceMock, $this->collection->current());
 }
Example #3
0
 /**
  * Returns price by code
  *
  * @param string $priceCode
  * @return PriceInterface
  */
 public function getPrice($priceCode)
 {
     return $this->priceCollection->get($priceCode);
 }