9 use \Magento\Setup\Controller\LandingUpdater;
10 use \Magento\Framework\App\ProductMetadata;
11 use \Magento\Framework\Composer\ComposerJsonFinder;
21 public function testIndexAction()
24 $productMetadataMock = $this->getMockBuilder(\
Magento\Framework\
App\ProductMetadata::class)
25 ->setMethods([
'getVersion'])
26 ->disableOriginalConstructor()
28 $productMetadataMock->expects($this->once())
29 ->method(
'getVersion')
30 ->willReturn($this::TEST_PRODUCT_VERSION);
33 $_SERVER[
'DOCUMENT_ROOT'] =
'some/doc/root/value';
35 $this->assertInstanceOf(\
Zend\View\Model\ViewModel::class,
$viewModel);
37 $this->assertEquals(
'/magento/setup/landing.phtml',
$viewModel->getTemplate());
39 $this->assertArrayHasKey(
'version', $variables);
40 $this->assertEquals($this::TEST_PRODUCT_VERSION, $variables[
'version']);
41 $this->assertArrayHasKey(
'welcomeMsg', $variables);
42 $this->assertArrayHasKey(
'docRef', $variables);
43 $this->assertArrayHasKey(
'agreeButtonText', $variables);
44 $this->assertEquals(
'Agree and Update Magento', $variables[
'agreeButtonText']);
const TEST_PRODUCT_VERSION