diff options
author | knut <> | 2007-05-29 20:43:14 +0000 |
---|---|---|
committer | knut <> | 2007-05-29 20:43:14 +0000 |
commit | f3931ef17118868d89103b54549345c5cb0f86bb (patch) | |
tree | 0b49f7cb30bb30e732abf2bac65aa5da8c00f5f1 /tests/unit/IO/TTextWriterTest.php | |
parent | 376a5af2d258f87e2be75b667850436987c68a55 (diff) |
added tests for TextWriter and added IO test suite
Diffstat (limited to 'tests/unit/IO/TTextWriterTest.php')
-rw-r--r-- | tests/unit/IO/TTextWriterTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/unit/IO/TTextWriterTest.php b/tests/unit/IO/TTextWriterTest.php new file mode 100644 index 00000000..c011acae --- /dev/null +++ b/tests/unit/IO/TTextWriterTest.php @@ -0,0 +1,32 @@ +<?php +require_once dirname(__FILE__).'/../phpunit.php'; + +Prado::using('System.IO.TTextWriter'); + +/** + * @package System.IO + */ +class TTextWriterTest extends PHPUnit_Framework_TestCase { + + public function testFlush() { + $writer = new TTextWriter(); + self::assertEquals('', $writer->flush()); + $writer->write('some text'); + self::assertEquals('some text', $writer->flush()); + } + + public function testWrite() { + $writer = new TTextWriter(); + $writer->write("some text\n"); + $writer->write("more text\n"); + self::assertEquals("some text\nmore text\n", $writer->flush()); + } + + public function testWriteLine() { + $writer = new TTextWriter(); + $writer->writeLine('some text'); + self::assertEquals("some text\n", $writer->flush()); + } +} + +?> |