From b8467164f84e9abbcace5bd949593a28e9543c52 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 14 Oct 2010 22:16:42 -0400 Subject: [PATCH] Making ConsoleOutput work correctly when multiple identical tags are used. --- cake/console/console_output.php | 2 +- cake/tests/cases/console/console_output.test.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/console/console_output.php b/cake/console/console_output.php index 2746c8285..783cba4ec 100644 --- a/cake/console/console_output.php +++ b/cake/console/console_output.php @@ -163,7 +163,7 @@ class ConsoleOutput { return strip_tags($text); } return preg_replace_callback( - '/<(?[a-z0-9-_]+)>(?.*)<\/(\1)>/i', array($this, '_replaceTags'), $text + '/<(?[a-z0-9-_]+)>(?.*?)<\/(\1)>/i', array($this, '_replaceTags'), $text ); } diff --git a/cake/tests/cases/console/console_output.test.php b/cake/tests/cases/console/console_output.test.php index 71f00a1bd..52db53f83 100644 --- a/cake/tests/cases/console/console_output.test.php +++ b/cake/tests/cases/console/console_output.test.php @@ -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('Bad Warning Regular', false); } /**