summaryrefslogtreecommitdiff
path: root/tests/unit/IO/TTextWriterTest.php
blob: 2ef149e4bda6cf3091ddec6e379e35d9ed529a16 (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
<?php

use Prado\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());
	}
}