Skip to content

Commit

Permalink
Annotate test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ravage84 committed Aug 11, 2015
1 parent a7b5f8c commit f3e590a
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions lib/Cake/Test/Case/Utility/CakeTextTest.php
Expand Up @@ -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);
Expand All @@ -39,6 +50,7 @@ public function tearDown() {
* testUuidGeneration method
*
* @return void
* @covers ::uuid
*/
public function testUuidGeneration() {
$result = CakeText::uuid();
Expand All @@ -51,6 +63,7 @@ public function testUuidGeneration() {
* testMultipleUuidGeneration method
*
* @return void
* @covers ::uuid
*/
public function testMultipleUuidGeneration() {
$check = array();
Expand All @@ -70,6 +83,7 @@ public function testMultipleUuidGeneration() {
* testInsert method
*
* @return void
* @covers ::insert
*/
public function testInsert() {
$string = 'some string';
Expand Down Expand Up @@ -231,6 +245,7 @@ public function testInsert() {
* test Clean Insert
*
* @return void
* @covers ::cleanInsert
*/
public function testCleanInsert() {
$result = CakeText::cleanInsert(':incomplete', array(
Expand Down Expand Up @@ -271,6 +286,7 @@ public function testCleanInsert() {
* CakeText::insert().
*
* @return void
* @covers ::insert
*/
public function testAutoIgnoreBadInsertData() {
$data = array('foo' => 'alpha', 'bar' => 'beta', 'fale' => array());
Expand All @@ -282,6 +298,7 @@ public function testAutoIgnoreBadInsertData() {
* testTokenize method
*
* @return void
* @covers ::tokenize
*/
public function testTokenize() {
$result = CakeText::tokenize('A,(short,boring test)');
Expand Down Expand Up @@ -318,6 +335,7 @@ public function testTokenize() {
* testReplaceWithQuestionMarkInString method
*
* @return void
* @covers ::insert
*/
public function testReplaceWithQuestionMarkInString() {
$string = ':a, :b and :c?';
Expand All @@ -331,6 +349,8 @@ public function testReplaceWithQuestionMarkInString() {
*
* @dataProvider wordWrapProvider
* @return void
* @covers ::wordWrap
* @covers ::_wordWrap
*/
public function testWordWrap($text, $width, $break = "\n", $cut = false) {
$result = CakeText::wordWrap($text, $width, $break, $cut);
Expand Down Expand Up @@ -364,6 +384,8 @@ public function wordWrapProvider() {
* test that wordWrap() properly handle unicode strings.
*
* @return void
* @covers ::wordWrap
* @covers ::_wordWrap
*/
public function testWordWrapUnicodeAware() {
$text = 'Но вим омниюм факёльиси элыктрам, мюнырэ лэгыры векж ыт. Выльёт квюандо нюмквуам ты кюм. Зыд эю рыбюм.';
Expand Down Expand Up @@ -391,6 +413,8 @@ public function testWordWrapUnicodeAware() {
* 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.
Expand All @@ -408,6 +432,9 @@ public function testWordWrapNewlineAware() {
* 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.';
Expand Down Expand Up @@ -443,6 +470,9 @@ public function testWrap() {
* 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.';
Expand All @@ -459,6 +489,7 @@ public function testWrapIndent() {
* testTruncate method
*
* @return void
* @covers ::truncate
*/
public function testTruncate() {
$text1 = 'The quick brown fox jumps over the lazy dog';
Expand Down Expand Up @@ -564,6 +595,7 @@ public function testTruncate() {
* testTruncate method with non utf8 sites
*
* @return void
* @covers ::truncate
*/
public function testTruncateLegacy() {
Configure::write('App.encoding', 'ISO-8859-1');
Expand All @@ -587,6 +619,7 @@ public function testTruncateLegacy() {
* testTail method
*
* @return void
* @covers ::tail
*/
public function testTail() {
$text1 = 'The quick brown fox jumps over the lazy dog';
Expand Down Expand Up @@ -630,6 +663,7 @@ public function testTail() {
* testHighlight method
*
* @return void
* @covers ::highlight
*/
public function testHighlight() {
$text = 'This is a test text';
Expand Down Expand Up @@ -664,6 +698,7 @@ public function testHighlight() {
* testHighlightHtml method
*
* @return void
* @covers ::highlight
*/
public function testHighlightHtml() {
$text1 = '<p>strongbow isn&rsquo;t real cider</p>';
Expand All @@ -690,6 +725,7 @@ public function testHighlightHtml() {
* testHighlightMulti method
*
* @return void
* @covers ::highlight
*/
public function testHighlightMulti() {
$text = 'This is a test text';
Expand All @@ -703,6 +739,7 @@ public function testHighlightMulti() {
* testStripLinks method
*
* @return void
* @covers ::stripLinks
*/
public function testStripLinks() {
$text = 'This is a test text';
Expand Down Expand Up @@ -730,6 +767,7 @@ public function testStripLinks() {
* testHighlightCaseInsensitivity method
*
* @return void
* @covers ::highlight
*/
public function testHighlightCaseInsensitivity() {
$text = 'This is a Test text';
Expand All @@ -746,6 +784,7 @@ public function testHighlightCaseInsensitivity() {
* testExcerpt method
*
* @return void
* @covers ::excerpt
*/
public function testExcerpt() {
$text = 'This is a phrase with test text to play with';
Expand Down Expand Up @@ -786,6 +825,7 @@ public function testExcerpt() {
* testExcerptCaseInsensitivity method
*
* @return void
* @covers ::excerpt
*/
public function testExcerptCaseInsensitivity() {
$text = 'This is a phrase with test text to play with';
Expand All @@ -803,6 +843,7 @@ public function testExcerptCaseInsensitivity() {
* testListGeneration method
*
* @return void
* @covers ::toList
*/
public function testListGeneration() {
$result = $this->Text->toList(array());
Expand Down

0 comments on commit f3e590a

Please sign in to comment.