diff options
author | friendica <info@friendica.com> | 2012-07-18 03:59:10 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-18 03:59:10 -0700 |
commit | 22cf19e174bcee88b44968f2773d1bad2da2b54d (patch) | |
tree | f4e01db6f73754418438b020c2327e18c256653c /lib/htmlpurifier/tests/FSTools | |
parent | 7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a (diff) | |
download | volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.tar.gz volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.tar.bz2 volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.zip |
bad sync with github windows client
Diffstat (limited to 'lib/htmlpurifier/tests/FSTools')
-rw-r--r-- | lib/htmlpurifier/tests/FSTools/FileSystemHarness.php | 36 | ||||
-rw-r--r-- | lib/htmlpurifier/tests/FSTools/FileTest.php | 46 |
2 files changed, 0 insertions, 82 deletions
diff --git a/lib/htmlpurifier/tests/FSTools/FileSystemHarness.php b/lib/htmlpurifier/tests/FSTools/FileSystemHarness.php deleted file mode 100644 index 710196e4f..000000000 --- a/lib/htmlpurifier/tests/FSTools/FileSystemHarness.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/** - * Test harness that sets up a filesystem sandbox for file-emulation - * functions to safely unit test in. - * - * @todo Make an automatic FSTools mock or something - */ -class FSTools_FileSystemHarness extends UnitTestCase -{ - - protected $dir, $oldDir; - - function __construct() { - parent::__construct(); - $this->dir = 'tmp/' . md5(uniqid(rand(), true)) . '/'; - mkdir($this->dir); - $this->oldDir = getcwd(); - - } - - function __destruct() { - FSTools::singleton()->rmdirr($this->dir); - } - - function setup() { - chdir($this->dir); - } - - function tearDown() { - chdir($this->oldDir); - } - -} - -// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/FSTools/FileTest.php b/lib/htmlpurifier/tests/FSTools/FileTest.php deleted file mode 100644 index e9b703a2d..000000000 --- a/lib/htmlpurifier/tests/FSTools/FileTest.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -require_once 'FSTools/FileSystemHarness.php'; - -/** - * These are not really unit tests, just sanity checks of basic functionality. - */ -class FSTools_FileTest extends FSTools_FileSystemHarness -{ - - function test() { - $name = 'test.txt'; - $file = new FSTools_File($name); - $this->assertFalse($file->exists()); - $file->write('foobar'); - $this->assertTrue($file->exists()); - $this->assertEqual($file->get(), 'foobar'); - $file->delete(); - $this->assertFalse($file->exists()); - } - - function testGetNonExistent() { - $name = 'notfound.txt'; - $file = new FSTools_File($name); - $this->expectError(); - $this->assertFalse($file->get()); - } - - function testHandle() { - $file = new FSTools_File('foo.txt'); - $this->assertFalse($file->exists()); - $file->open('w'); - $this->assertTrue($file->exists()); - $file->put('Foobar'); - $file->close(); - $file->open('r'); - $this->assertIdentical('F', $file->getChar()); - $this->assertFalse($file->eof()); - $this->assertIdentical('oo', $file->read(2)); - $this->assertIdentical('bar', $file->getLine()); - $this->assertTrue($file->eof()); - } - -} - -// vim: et sw=4 sts=4 |