function testFlush()
  {
    $this->_writeSimpleCache('p_test1', $content1 = 'test-content1');
    $this->_writeSimpleCache('p_test2', $content2 ='test-content2');
    $this->_writeSimpleCache('not_page_file', $content3 ='test-content3');

    $cache_manager = new PartialPageCacheManager();
    $cache_manager->flush();

    $files = Fs :: findSubitems(PAGE_CACHE_DIR);

    $this->assertEqual(sizeof($files), 1);

    $file = reset($files);
    $this->assertEqual(Fs :: cleanPath($file), Fs :: cleanPath(PAGE_CACHE_DIR . Fs :: separator() . 'not_page_file'));

    $this->_cleanSimpleCache('not_page_file');
  }
  function testFindSubitems()
  {
    $this->_createFileSystem();

    $res = Fs :: findSubitems(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey');
  sort($res);

    $this->assertEqual(
      $res,
      array(
        Fs :: cleanPath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_1'),
        Fs :: cleanPath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_2'),
        Fs :: cleanPath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_3')
      )
    );

    $res = Fs :: findSubitems(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/', 'f', '/^test2_1$/');
    sort($res);

    $this->assertEqual(
      $res,
      array(
        Fs :: cleanPath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_2'),
        Fs :: cleanPath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_3'),
      )
    );

    $this->_removeFileSystem();
  }
  public function getCacheSize()
  {
    Fs :: mkdir(PAGE_CACHE_DIR);

    $files = Fs :: findSubitems(PAGE_CACHE_DIR, 'f', '~^[^p]~');

    $size = 0;

    foreach($files as $file)
    {
      $size += (filesize($file));
    }

    return $size;
  }