summaryrefslogtreecommitdiff
path: root/tests/unit/IO/TTextWriterTest.php
blob: c011acaee74ca1b77144838295ac68a59a069b29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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());
	}
}

?>