Ejemplo n.º 1
0
 /**
  * test method getValue
  *
  * @dataProvider getValueDataProvider
  */
 public function testGetValue($specialPriceValue, $expectedResult)
 {
     $this->priceInfoMock->expects($this->once())->method('getPrices')->will($this->returnValue($this->prices));
     $this->regularPriceMock->expects($this->exactly(3))->method('getValue')->will($this->returnValue(100));
     $this->tearPriceMock->expects($this->exactly(2))->method('getValue')->will($this->returnValue(99));
     $this->specialPriceMock->expects($this->any())->method('getValue')->will($this->returnValue($specialPriceValue));
     $this->assertSame($expectedResult, $this->basePrice->getValue());
 }
Ejemplo n.º 2
0
 /**
  * @param string $key
  * @param string $method
  * @param array $returnMap
  * @param string $expectedValue
  *
  * @dataProvider getValueDataProvider
  */
 public function testGetValue($key, $method, $returnMap, $expectedValue)
 {
     $this->config->setMethod($method);
     $this->scopeConfigMock->expects($this->any())->method('getValue')->willReturnMap($returnMap);
     $this->assertEquals($expectedValue, $this->config->getValue($key));
 }