mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Making ConsoleOutput work correctly when multiple identical tags are used.
This commit is contained in:
parent
0428320c78
commit
b8467164f8
2 changed files with 5 additions and 2 deletions
|
@ -163,7 +163,7 @@ class ConsoleOutput {
|
|||
return strip_tags($text);
|
||||
}
|
||||
return preg_replace_callback(
|
||||
'/<(?<tag>[a-z0-9-_]+)>(?<text>.*)<\/(\1)>/i', array($this, '_replaceTags'), $text
|
||||
'/<(?<tag>[a-z0-9-_]+)>(?<text>.*?)<\/(\1)>/i', array($this, '_replaceTags'), $text
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -194,7 +194,10 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testFormattingMultipleSameTags() {
|
||||
$this->markTestIncomplete('This test needs to be written.');
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with("\033[31;4mBad\033[0m \033[31;4mWarning\033[0m Regular");
|
||||
|
||||
$this->output->write('<error>Bad</error> <error>Warning</error> Regular', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue