/** * @param mixed $labelText * @param string $attributeCode * @param string $expectedResult * @dataProvider getLabelDataProvider */ public function testGetLocalizedLabel($labelText, $attributeCode, $expectedResult) { $this->attributeMock->expects($this->exactly(2))->method('getFrontendLabel')->willReturn($labelText); $this->attributeMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); $this->assertInstanceOf('\\Magento\\Framework\\Phrase', $this->model->getLocalizedLabel()); $this->assertSame($expectedResult, (string) $this->model->getLocalizedLabel()); }