Example #1
0
 /**
  * @covers \Magento\Eav\Model\Attribute\Data\File::outputValue
  *
  * @param string $format
  * @param mixed $value
  * @param mixed $expectedResult
  * @param int $callTimes
  * @dataProvider outputValueDataProvider
  */
 public function testOutputValue($format, $value, $callTimes, $expectedResult)
 {
     $entityMock = $this->getMock('\\Magento\\Framework\\Model\\AbstractModel', [], [], '', false);
     $entityMock->expects($this->once())->method('getData')->will($this->returnValue($value));
     $attributeMock = $this->getMock('\\Magento\\Eav\\Model\\Attribute', [], [], '', false);
     $this->urlEncoder->expects($this->exactly($callTimes))->method('encode')->will($this->returnValue('url_key'));
     $this->model->setEntity($entityMock);
     $this->model->setAttribute($attributeMock);
     $this->assertEquals($expectedResult, $this->model->outputValue($format));
 }