public function testGetMetadataValues() { $expectedData = (include __DIR__ . '/_files/MetaData.php'); /** @var \Magento\SalesRule\Model\Rule|\PHPUnit_Framework_MockObject_MockObject $ruleMock */ $ruleMock = $this->getMock('Magento\\SalesRule\\Model\\Rule', [], [], '', false); $this->ruleFactoryMock->expects($this->once())->method('create')->willReturn($ruleMock); $ruleMock->expects($this->once())->method('getCouponTypes')->willReturn(['key1' => 'couponType1', 'key2' => 'couponType2']); $ruleMock->expects($this->once())->method('getStoreLabels')->willReturn(['label0']); $test = $this->model->getMetadataValues($ruleMock); $this->assertEquals($expectedData, $test); }
/** * Get metadata values * * @return array */ protected function getMetadataValues() { $rule = $this->coreRegistry->registry(\Magento\SalesRule\Model\RegistryConstants::CURRENT_SALES_RULE); return $this->metadataValueProvider->getMetadataValues($rule); }