File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
dev/tests/static/testsuite/Magento/Test/Php Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 2323 */
2424class LiveCodeTest extends \PHPUnit \Framework \TestCase
2525{
26+ /**
27+ * @var \Magento\Framework\Shell
28+ */
29+ protected $ _shell ;
30+
31+ /**
32+ * @var string
33+ */
34+ protected $ _command ;
35+
2636 /**
2737 * @var string
2838 */
@@ -33,6 +43,29 @@ class LiveCodeTest extends \PHPUnit\Framework\TestCase
3343 */
3444 protected static $ pathToSource = '' ;
3545
46+ /**
47+ * @var boolean
48+ */
49+ protected static $ executedCompilation = false ;
50+
51+ /**
52+ * Setup compilation
53+ *
54+ * @return void
55+ */
56+ protected function setUp (): void
57+ {
58+ if (!self ::$ executedCompilation ){
59+ $ this ->_shell = new \Magento \Framework \Shell (new \Magento \Framework \Shell \CommandRenderer ());
60+ $ basePath = BP ;
61+ $ basePath = str_replace ('\\' , '/ ' , $ basePath );
62+
63+ $ this ->_command = 'php ' . $ basePath . '/bin/magento setup:di:compile ' ;
64+ $ this ->_shell ->execute ($ this ->_command );
65+ self ::$ executedCompilation = true ;
66+ }
67+ }
68+
3669 /**
3770 * Setup basics for all tests
3871 *
You can’t perform that action at this time.
0 commit comments