3 require_once 'FSTools/FileSystemHarness.php';
6 * These are not really unit tests, just sanity checks of basic functionality.
8 class FSTools_FileTest
extends FSTools_FileSystemHarness
13 $file = new FSTools_File($name);
14 $this->assertFalse($file->exists());
15 $file->write('foobar');
16 $this->assertTrue($file->exists());
17 $this->assertEqual($file->get(), 'foobar');
19 $this->assertFalse($file->exists());
22 function testGetNonExistent() {
23 $name = 'notfound.txt';
24 $file = new FSTools_File($name);
26 $this->assertFalse($file->get());
29 function testHandle() {
30 $file = new FSTools_File('foo.txt');
31 $this->assertFalse($file->exists());
33 $this->assertTrue($file->exists());
37 $this->assertIdentical('F', $file->getChar());
38 $this->assertFalse($file->eof());
39 $this->assertIdentical('oo', $file->read(2));
40 $this->assertIdentical('bar', $file->getLine());
41 $this->assertTrue($file->eof());