16 private $productMetadata;
21 private $composerInformationMock;
25 $this->composerInformationMock = $this->getMockBuilder(\
Magento\Framework\Composer\ComposerInformation::class)
26 ->disableOriginalConstructor()->getMock();
29 $this->productMetadata =
$objectManager->getObject(ProductMetadata::class);
30 $reflectionProperty = new \ReflectionProperty($this->productMetadata,
'composerInformation');
31 $reflectionProperty->setAccessible(
true);
32 $reflectionProperty->setValue($this->productMetadata, $this->composerInformationMock);
42 $this->composerInformationMock->expects($this->any())->method(
'getSystemPackages')->willReturn($packageList);
43 $productVersion = $this->productMetadata->getVersion();
44 $this->assertNotEmpty($productVersion,
'Empty product version');
45 $this->assertEquals($expectedVersion, $productVersion);
57 'name' =>
'magento/product-community-edition',
58 'version' =>
'123.456.789' 61 'name' =>
'magento/product-other-edition',
62 'version' =>
'987.654.321' 76 $productEdition = $this->productMetadata->getEdition();
77 $this->assertNotEmpty($productEdition,
'Empty product edition');
82 $productName = $this->productMetadata->getName();
83 $this->assertNotEmpty($productName,
'Empty product name');