Skip to content

Commit 7596279

Browse files
authored
fix: Fixed test Transformers (#9778)
1 parent 6a64c4c commit 7596279

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/system/Commands/TransformerGeneratorTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ final class TransformerGeneratorTest extends CIUnitTestCase
2727

2828
protected function tearDown(): void
2929
{
30-
$result = str_replace(["\033[0;32m", "\033[0m", "\n"], '', $this->getStreamFilterBuffer());
31-
$file = str_replace('APPPATH' . DIRECTORY_SEPARATOR, APPPATH, trim(substr($result, 14)));
30+
$result = str_replace(["\033[0;33m", "\033[0;32m", "\033[0m", "\n"], '', $this->getStreamFilterBuffer());
31+
preg_match('/APPPATH(\/[^\s"]+\.php)/', $result, $matches);
32+
$file = isset($matches[0]) ? str_replace('APPPATH' . DIRECTORY_SEPARATOR, APPPATH, $matches[0]) : '';
33+
3234
if (is_file($file)) {
3335
unlink($file);
3436
}

0 commit comments

Comments
 (0)