From f3e590acfbcd75dc505c10edfd7433efd895153f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Tue, 11 Aug 2015 16:29:48 +0200 Subject: [PATCH] Annotate test coverage --- lib/Cake/Test/Case/Utility/CakeTextTest.php | 45 ++++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Test/Case/Utility/CakeTextTest.php b/lib/Cake/Test/Case/Utility/CakeTextTest.php index 7eface6e9..2e085c39a 100644 --- a/lib/Cake/Test/Case/Utility/CakeTextTest.php +++ b/lib/Cake/Test/Case/Utility/CakeTextTest.php @@ -19,17 +19,28 @@ App::uses('CakeText', 'Utility'); /** - * CakeTextTest class + * CakeText Tests * - * @package Cake.Test.Case.Utility + * @package Cake.Test.Case.Utility + * @coversDefaultClass CakeText */ class CakeTextTest extends CakeTestCase { +/** + * Setup object under test + * + * @return void + */ public function setUp() { parent::setUp(); $this->Text = new CakeText(); } +/** + * Tear down object under test + * + * @return void + */ public function tearDown() { parent::tearDown(); unset($this->Text); @@ -39,6 +50,7 @@ class CakeTextTest extends CakeTestCase { * testUuidGeneration method * * @return void + * @covers ::uuid */ public function testUuidGeneration() { $result = CakeText::uuid(); @@ -51,6 +63,7 @@ class CakeTextTest extends CakeTestCase { * testMultipleUuidGeneration method * * @return void + * @covers ::uuid */ public function testMultipleUuidGeneration() { $check = array(); @@ -70,6 +83,7 @@ class CakeTextTest extends CakeTestCase { * testInsert method * * @return void + * @covers ::insert */ public function testInsert() { $string = 'some string'; @@ -231,6 +245,7 @@ class CakeTextTest extends CakeTestCase { * test Clean Insert * * @return void + * @covers ::cleanInsert */ public function testCleanInsert() { $result = CakeText::cleanInsert(':incomplete', array( @@ -271,6 +286,7 @@ class CakeTextTest extends CakeTestCase { * CakeText::insert(). * * @return void + * @covers ::insert */ public function testAutoIgnoreBadInsertData() { $data = array('foo' => 'alpha', 'bar' => 'beta', 'fale' => array()); @@ -282,6 +298,7 @@ class CakeTextTest extends CakeTestCase { * testTokenize method * * @return void + * @covers ::tokenize */ public function testTokenize() { $result = CakeText::tokenize('A,(short,boring test)'); @@ -318,6 +335,7 @@ class CakeTextTest extends CakeTestCase { * testReplaceWithQuestionMarkInString method * * @return void + * @covers ::insert */ public function testReplaceWithQuestionMarkInString() { $string = ':a, :b and :c?'; @@ -331,6 +349,8 @@ class CakeTextTest extends CakeTestCase { * * @dataProvider wordWrapProvider * @return void + * @covers ::wordWrap + * @covers ::_wordWrap */ public function testWordWrap($text, $width, $break = "\n", $cut = false) { $result = CakeText::wordWrap($text, $width, $break, $cut); @@ -364,6 +384,8 @@ class CakeTextTest extends CakeTestCase { * test that wordWrap() properly handle unicode strings. * * @return void + * @covers ::wordWrap + * @covers ::_wordWrap */ public function testWordWrapUnicodeAware() { $text = 'Но вим омниюм факёльиси элыктрам, мюнырэ лэгыры векж ыт. Выльёт квюандо нюмквуам ты кюм. Зыд эю рыбюм.'; @@ -391,6 +413,8 @@ TEXT; * test that wordWrap() properly handle newline characters. * * @return void + * @covers ::wordWrap + * @covers ::_wordWrap */ public function testWordWrapNewlineAware() { $text = 'This is a line that is almost the 55 chars long. @@ -408,6 +432,9 @@ TEXT; * test wrap method. * * @return void + * @covers ::wrap + * @covers ::wordWrap + * @covers ::_wordWrap */ public function testWrap() { $text = 'This is the song that never ends. This is the song that never ends. This is the song that never ends.'; @@ -443,6 +470,9 @@ TEXT; * test wrap() indenting * * @return void + * @covers ::wrap + * @covers ::wordWrap + * @covers ::_wordWrap */ public function testWrapIndent() { $text = 'This is the song that never ends. This is the song that never ends. This is the song that never ends.'; @@ -459,6 +489,7 @@ TEXT; * testTruncate method * * @return void + * @covers ::truncate */ public function testTruncate() { $text1 = 'The quick brown fox jumps over the lazy dog'; @@ -564,6 +595,7 @@ podeís adquirirla.

* testTruncate method with non utf8 sites * * @return void + * @covers ::truncate */ public function testTruncateLegacy() { Configure::write('App.encoding', 'ISO-8859-1'); @@ -587,6 +619,7 @@ podeís adquirirla.

* testTail method * * @return void + * @covers ::tail */ public function testTail() { $text1 = 'The quick brown fox jumps over the lazy dog'; @@ -630,6 +663,7 @@ podeís adquirirla.

* testHighlight method * * @return void + * @covers ::highlight */ public function testHighlight() { $text = 'This is a test text'; @@ -664,6 +698,7 @@ podeís adquirirla.

* testHighlightHtml method * * @return void + * @covers ::highlight */ public function testHighlightHtml() { $text1 = '

strongbow isn’t real cider

'; @@ -690,6 +725,7 @@ podeís adquirirla.

* testHighlightMulti method * * @return void + * @covers ::highlight */ public function testHighlightMulti() { $text = 'This is a test text'; @@ -703,6 +739,7 @@ podeís adquirirla.

* testStripLinks method * * @return void + * @covers ::stripLinks */ public function testStripLinks() { $text = 'This is a test text'; @@ -730,6 +767,7 @@ podeís adquirirla.

* testHighlightCaseInsensitivity method * * @return void + * @covers ::highlight */ public function testHighlightCaseInsensitivity() { $text = 'This is a Test text'; @@ -746,6 +784,7 @@ podeís adquirirla.

* testExcerpt method * * @return void + * @covers ::excerpt */ public function testExcerpt() { $text = 'This is a phrase with test text to play with'; @@ -786,6 +825,7 @@ podeís adquirirla.

* testExcerptCaseInsensitivity method * * @return void + * @covers ::excerpt */ public function testExcerptCaseInsensitivity() { $text = 'This is a phrase with test text to play with'; @@ -803,6 +843,7 @@ podeís adquirirla.

* testListGeneration method * * @return void + * @covers ::toList */ public function testListGeneration() { $result = $this->Text->toList(array());