9 use \Magento\Setup\Model\BasePackageInfo;
20 private $readFactoryMock;
30 private $basePackageInfo;
34 $this->readFactoryMock = $this->createMock(\
Magento\Framework\
Filesystem\Directory\ReadFactory::class);
35 $this->readerMock = $this->getMockForAbstractClass(
41 $this->readFactoryMock->expects($this->once())->method(
'create')->willReturn($this->readerMock);
48 $this->readerMock->expects($this->once())->method(
'isExist')->willReturn(
false);
49 $this->readerMock->expects($this->never())->method(
'isReadable');
50 $this->readerMock->expects($this->never())->method(
'readFile');
52 $this->expectExceptionMessage(
55 $this->basePackageInfo->getPaths();
61 $this->readerMock->expects($this->once())->method(
'isExist')->willReturn(
true);
62 $this->readerMock->expects($this->once())->method(
'isReadable')->willReturn(
false);
63 $this->readerMock->expects($this->never())->method(
'readFile');
65 $this->expectExceptionMessage(
68 $this->basePackageInfo->getPaths();
74 $this->readerMock->expects($this->once())->method(
'isExist')->willReturn(
true);
75 $this->readerMock->expects($this->once())->method(
'isReadable')->willReturn(
true);
76 $jsonData = json_encode(
85 $this->readerMock->expects($this->once())->method(
'readFile')->willReturn($jsonData);
87 $actualList = $this->basePackageInfo->getPaths();
88 $this->assertEquals($expectedList, $actualList);
94 $this->readerMock->expects($this->once())->method(
'isExist')->willReturn(
true);
95 $this->readerMock->expects($this->once())->method(
'isReadable')->willReturn(
true);
96 $jsonData = json_encode(
114 $this->readerMock->expects($this->once())->method(
'readFile')->willReturn($jsonData);
116 $actualList = $this->basePackageInfo->getPaths();
117 $this->assertEquals($expectedList, $actualList);
testBaseNoExtraMapSectionInComposerJsonFile()
testBaseComposerJsonFileNotFound()
const MAGENTO_BASE_PACKAGE_COMPOSER_JSON_FILE
defined('TESTS_BP')||define('TESTS_BP' __DIR__
defined('MTF_BOOT_FILE')||define('MTF_BOOT_FILE' __FILE__
testBaseComposerJsonFileNotReadable()