File tree Expand file tree Collapse file tree 10 files changed +92
-126
lines changed
IntegrationTesting/PhpUnitFile Expand file tree Collapse file tree 10 files changed +92
-126
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
77## [ Unreleased]
88
9+ ## [ 0.1.2] - 2021-05-13
10+ ### Fixed
11+ - Fix new path validator by using "hack files"
12+
913## [ 0.1.1] - 2020-07-29
1014### Fixed
1115- Fixed 2.4 compatibility
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Yireo \DevHacks \Console \Command ;
4+
5+ use Symfony \Component \Console \Command \Command ;
6+ use Symfony \Component \Console \Input \InputArgument ;
7+ use Symfony \Component \Console \Input \InputInterface ;
8+ use Symfony \Component \Console \Output \OutputInterface ;
9+
10+ class CopyHacks extends Command
11+ {
12+ protected function configure ()
13+ {
14+ $ this ->setName ('yireo_devhacks:copy_hacks ' )
15+ ->setDescription ('Copy some hacks ' );
16+ }
17+
18+ protected function execute (InputInterface $ input , OutputInterface $ output )
19+ {
20+ $ copyDir = dirname (__DIR__ ) . '/../Copy ' ;
21+ $ copies = [
22+ \Magento \Framework \Filesystem \Directory \PathValidator::class => 'PathValidator.php '
23+ ];
24+
25+ foreach ($ copies as $ className => $ copyFile ) {
26+ $ originalFile = (new \ReflectionClass ($ className ))->getFileName ();
27+ if (!file_exists ($ originalFile )) {
28+ $ output ->writeln ('<error>Original file does not exist: ' . $ originalFile . '</error> ' );
29+ continue ;
30+ }
31+
32+ $ copyFile = $ copyDir . '/ ' . $ copyFile ;
33+ if (!file_exists ($ copyFile )) {
34+ $ output ->writeln ('<error>Hack file does not exist: ' . $ copyFile . '</error> ' );
35+ continue ;
36+ }
37+
38+ copy ($ copyFile , $ originalFile );
39+ }
40+ }
41+ }
Original file line number Diff line number Diff line change 1- <?php
2-
3- declare (strict_types=1 );
1+ <?php declare (strict_types=1 );
42
53namespace Yireo \DevHacks \Console \Command \IntegrationTesting \PhpUnitFile ;
64
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Magento \Framework \Filesystem \Directory ;
4+
5+ use Magento \Framework \Filesystem \DriverInterface ;
6+
7+ /**
8+ * @inheritDoc
9+ *
10+ * Validates paths using driver.
11+ */
12+ class PathValidator implements PathValidatorInterface
13+ {
14+ /**
15+ * @param DriverInterface $driver
16+ */
17+ public function __construct (DriverInterface $ driver )
18+ {
19+ }
20+
21+ /**
22+ * @inheritDoc
23+ */
24+ public function validate (
25+ string $ directoryPath ,
26+ string $ path ,
27+ ?string $ scheme = null ,
28+ bool $ absolutePath = false
29+ ): void {}
30+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Yireo \DevHacks \Override ;
4+
5+ use Magento \Framework \View \Element \Template \File \Validator ;
6+
7+ class TemplateFileValidator extends Validator
8+ {
9+ public function isValid ($ filename )
10+ {
11+ return true ;
12+ }
13+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11{
22 "name" : " yireo/magento2-devhacks" ,
3- "version" : " 0.1.1 " ,
3+ "version" : " 0.1.2 " ,
44 "license" : " OSL-3.0" ,
55 "type" : " magento2-module" ,
66 "homepage" : " https://github.com/yireo/Yireo_DevHacks" ,
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
22<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
3- <preference for =" Magento\Framework\Filesystem\Directory\ReadFactory" type =" Yireo\DevHacks\Override\DirectoryReadFactoryWithPathFixed" />
4-
5- <preference for =" Magento\Framework\Filesystem\Directory\ReadInterface" type =" Yireo\DevHacks\Override\DirectoryReadWithPathFixed" />
6-
7- <type name =" Magento\Framework\View\Element\Template\File\Validator" >
8- <plugin name =" templatesymlink_view_element_template_file_validator" type =" Yireo\DevHacks\Plugin\FileValidator" sortOrder =" 10" disabled =" false" />
9- </type >
3+ <preference for =" Magento\Framework\View\Element\Template\File\Validator" type =" Yireo\DevHacks\Override\TemplateFileValidator" />
104
115 <type name =" Magento\Framework\Console\CommandList" >
126 <arguments >
137 <argument name =" commands" xsi : type =" array" >
148 <item name =" yireo_devhacks_integrationtesting_phpunit_toggletestscleanup" xsi : type =" object" >Yireo\DevHacks\Console\Command\IntegrationTesting\PhpUnitFile\ToggleTestsCleanup</item >
9+ <item name =" yireo_devhacks_copy_hacks" xsi : type =" object" >Yireo\DevHacks\Console\Command\CopyHacks</item >
1510 </argument >
1611 </arguments >
1712 </type >
You can’t perform that action at this time.
0 commit comments