Exemple #1
0
 public function testFlush()
 {
     //Setting a file so we know something will be removed
     $home = getenv('HOME');
     $dir_name = "{$home}/.terminus/cache";
     $file_name = "{$dir_name}/" . $this->test_file_name;
     setOutputDestination($file_name);
     $old_count = count(scandir($dir_name));
     $this->file_cache->flush();
     $new_count = count(scandir($dir_name));
     $this->assertTrue($new_count < $old_count);
     //Running again when nothing should be removed
     $this->file_cache->flush();
     $new_new_count = count(scandir($dir_name));
     $this->assertTrue($new_count == $new_new_count);
 }