mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
d80befbe9b
Composer installs path repositories as symlinks by default, which causes Magento's template engine to fail when resolving .phtml files. Setting `COMPOSER_MIRROR_PATH_REPOS=1` on all composer install steps forces a copy instead, matching how the package would be installed from Packagist in production. Adds a .phtml template and an integration test to the demo package that renders it via Magento's template engine. Without COMPOSER_MIRROR_PATH_REPOS=1 the path repo is installed as a symlink and the test fails; with mirroring it passes. Closes #217
25 lines
769 B
PHP
25 lines
769 B
PHP
<?php
|
|
|
|
namespace Graycore\DemoPackage\Test\Integration;
|
|
|
|
use Magento\Framework\View\Element\Template;
|
|
use Magento\TestFramework\Helper\Bootstrap;
|
|
|
|
/**
|
|
* Fails when the extension is installed as a symlink (default Composer path repo behavior)
|
|
* because Magento's template engine cannot resolve .phtml files through symlinks.
|
|
* Requires COMPOSER_MIRROR_PATH_REPOS=1 during composer install.
|
|
*/
|
|
class TemplateRenderTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
/**
|
|
* @magentoAppArea frontend
|
|
*/
|
|
public function testTemplateRendersWithoutSymlinkError()
|
|
{
|
|
$block = Bootstrap::getObjectManager()->create(Template::class);
|
|
$block->setTemplate('Graycore_DemoPackage::demo.phtml');
|
|
$this->assertNotEmpty($block->toHtml());
|
|
}
|
|
}
|