Add swiftmailer external.
[xhtml-compiler.git] / tests / XHTMLCompiler / FileSystemHarness.php
blobaac43dcb8057c73a4dfdeecdd120d87f59fb0b2b
1 <?php
3 /**
4 * Test harness that sets up a filesystem sandbox for file-emulation
5 * functions to safely unit test in.
6 */
7 class XHTMLCompiler_FileSystemHarness extends UnitTestCase
10 protected $dir, $oldDir;
12 public function __construct() {
13 parent::__construct();
14 $this->dir = 'tmp/' . md5(uniqid(rand(), true)) . '/';
15 mkdir($this->dir);
16 $this->oldDir = getcwd();
20 public function __destruct() {
21 // individual tests must be sure to destroy their own files!
22 rmdir($this->dir);
25 public function setup() {
26 chdir($this->dir);
29 public function tearDown() {
30 chdir($this->oldDir);