Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Fix unit tests, they were not working because of namespace changes and
Browse files Browse the repository at this point in the history
class refactoring.
  • Loading branch information
billkarwin committed Oct 16, 2010
1 parent 2ce8fcd commit bbe7127
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 58 deletions.
5 changes: 0 additions & 5 deletions test/FigletTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,3 @@ protected function _equalAgainstFile($output, $file)
$this->assertEquals($compareString, $output);
}
}

// Call Zend_Text_FigletTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "Zend_Text_FigletTest::main") {
\Zend_Text_FigletTest::main();
}
29 changes: 2 additions & 27 deletions test/MultiByteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
namespace ZendTest\Text;
use Zend\Text;

// Call Zend_Text_MultiByteTest::main() if this source file is executed directly.
if (!defined("PHPUnit_MAIN_METHOD")) {
define("PHPUnit_MAIN_METHOD", "Zend_Text_MultiByteTest::main");
}

/**
* Test helper
*/

/**
* Zend_Text_MultiByte
*/
Expand All @@ -48,17 +39,6 @@
*/
class MultiByteTest extends \PHPUnit_Framework_TestCase
{
/**
* Runs the test methods of this class.
*
* @return void
*/
public static function main()
{
$suite = new \PHPUnit_Framework_TestSuite("Zend_Text_MultiByteTest");
$result = \PHPUnit_TextUI_TestRunner::run($suite);
}

/**
* Standard cut tests
*/
Expand All @@ -82,7 +62,7 @@ public function testWordWrapCutMultiLineShortWords()

public function testWordWrapCutMultiLineWithPreviousNewlines()
{
$line = Zend_Text_MultiByte::wordWrap("Ä very\nlong wöööööööööööörd.", 8, "\n", false);
$line = Text\MultiByte::wordWrap("Ä very\nlong wöööööööööööörd.", 8, "\n", false);
$this->assertEquals("Ä very\nlong\nwöööööööööööörd.", $line);
}

Expand All @@ -91,7 +71,7 @@ public function testWordWrapCutMultiLineWithPreviousNewlines()
*/
public function testWordWrapLongBreak()
{
$line = Zend_Text_MultiByte::wordWrap("Ä very<br>long wöö<br>öööööööö<br>öörd.", 8, '<br>', false);
$line = Text\MultiByte::wordWrap("Ä very<br>long wöö<br>öööööööö<br>öörd.", 8, '<br>', false);
$this->assertEquals("Ä very<br>long<br>wöö<br>öööööööö<br>öörd.", $line);
}

Expand Down Expand Up @@ -254,8 +234,3 @@ public function testRightPad()
$this->assertEquals('äääöö', $text);
}
}

// Call Zend_Text_MultiByteTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "Zend_Text_MultiByteTest::main") {
\Zend_Text_MultiByteTest::main();
}
26 changes: 0 additions & 26 deletions test/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@
use Zend\Text\Table;
use Zend\Text\Table\Decorator;

// Call Zend_Text_FigletTest::main() if this source file is executed directly.
if (!defined("PHPUnit_MAIN_METHOD")) {
define("PHPUnit_MAIN_METHOD", "Zend_Text_TableTest::main");
}

/**
* Test helper
*/


/**
* @category Zend
* @package Zend_Text
Expand All @@ -46,17 +36,6 @@
*/
class TableTest extends \PHPUnit_Framework_TestCase
{
/**
* Runs the test methods of this class.
*
* @return void
*/
public static function main()
{
$suite = new \PHPUnit_Framework_TestSuite("Zend_Text_TableTest");
$result = \PHPUnit_TextUI_TestRunner::run($suite);
}

public function tearDown()
{
Table\Table::setInputCharset('utf-8');
Expand Down Expand Up @@ -490,8 +469,3 @@ public function testDecoratorAscii()
$this->assertEquals($chars, '+++-++++|++');
}
}

// Call Zend_Text_TableTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "Zend_Text_TableTest::main") {
\Zend_Text_TableTest::main();
}

0 comments on commit bbe7127

Please sign in to comment.