Merge pull request #7214 from ravage84/2.7-caktetext-coverage

CakeTextTest Annotate test coverage
This commit is contained in:
Mark Story 2015-08-11 12:12:09 -04:00
commit 979820b884

View file

@ -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.</span></p>
* 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.</span></p>
* 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.</span></p>
* testHighlight method
*
* @return void
* @covers ::highlight
*/
public function testHighlight() {
$text = 'This is a test text';
@ -664,6 +698,7 @@ podeís adquirirla.</span></p>
* testHighlightHtml method
*
* @return void
* @covers ::highlight
*/
public function testHighlightHtml() {
$text1 = '<p>strongbow isn&rsquo;t real cider</p>';
@ -690,6 +725,7 @@ podeís adquirirla.</span></p>
* testHighlightMulti method
*
* @return void
* @covers ::highlight
*/
public function testHighlightMulti() {
$text = 'This is a test text';
@ -703,6 +739,7 @@ podeís adquirirla.</span></p>
* testStripLinks method
*
* @return void
* @covers ::stripLinks
*/
public function testStripLinks() {
$text = 'This is a test text';
@ -730,6 +767,7 @@ podeís adquirirla.</span></p>
* testHighlightCaseInsensitivity method
*
* @return void
* @covers ::highlight
*/
public function testHighlightCaseInsensitivity() {
$text = 'This is a Test text';
@ -746,6 +784,7 @@ podeís adquirirla.</span></p>
* 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.</span></p>
* 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.</span></p>
* testListGeneration method
*
* @return void
* @covers ::toList
*/
public function testListGeneration() {
$result = $this->Text->toList(array());