示例#1
0
文件: FifoTest.php 项目: jasny/Q
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     $this->file = sys_get_temp_dir() . '/q-fs_fifotest-' . md5(uniqid());
     if (!posix_mkfifo($this->file, 0777)) {
         $this->markTestSkipped("Could not create fifo file '{$this->file}'.");
     }
     $this->Fs_Node = new Fs_Fifo($this->file);
     parent::setUp();
 }
示例#2
0
文件: FileTest.php 项目: jasny/Q
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     $this->file = sys_get_temp_dir() . '/q-fs_filetest-' . md5(uniqid());
     if (!file_put_contents($this->file, 'Test case for Fs_File')) {
         $this->markTestSkipped("Could not write to '{$this->file}'.");
     }
     $this->Fs_Node = new Fs_File($this->file);
     parent::setUp();
 }
示例#3
0
文件: SocketTest.php 项目: jasny/Q
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     $this->file = sys_get_temp_dir() . '/q-fs_sockettest-' . md5(uniqid());
     $errno = null;
     $errstr = null;
     $this->socket = stream_socket_server('unix://' . $this->file, $errno, $errstr);
     if (!$this->socket) {
         $this->markTestSkipped("Could not create socket: {$errstr} ({$errno})");
     }
     $this->Fs_Node = new Fs_Socket($this->file);
     parent::setUp();
 }
示例#4
0
文件: DirTest.php 项目: jasny/Q
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     $this->file = sys_get_temp_dir() . '/q-fs_filetest-' . md5(uniqid());
     if (!mkdir($this->file)) {
         $this->markTestSkipped("Could not create directory '{$this->file}'");
     }
     if (!file_put_contents("{$this->file}/" . basename($this->file), 'Test case for Fs_Dir')) {
         $this->markTestSkipped("Could not create file '{$this->file}/ " . basename($this->file) . "'");
     }
     $this->Fs_Node = new Fs_Dir($this->file);
     parent::setUp();
 }
示例#5
0
文件: CharTest.php 项目: jasny/Q
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     $this->file = "/dev/zero";
     $this->Fs_Node = new Fs_Char($this->file);
     parent::setUp();
 }
示例#6
0
文件: BlockTest.php 项目: jasny/Q
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     $this->file = "/dev/loop0";
     $this->Fs_Node = new Fs_Block($this->file);
     parent::setUp();
 }