當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dir::hasSingleSubdir方法代碼示例

本文整理匯總了PHP中Dir::hasSingleSubdir方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dir::hasSingleSubdir方法的具體用法?PHP Dir::hasSingleSubdir怎麽用?PHP Dir::hasSingleSubdir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dir的用法示例。


在下文中一共展示了Dir::hasSingleSubdir方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testCreateStorageOnWrite

 function testCreateStorageOnWrite()
 {
     Storage::set_storage_root(DS . FRAMEWORK_CORE_PATH . "tests/io/storage_dir/");
     $d = new Dir(DS . FRAMEWORK_CORE_PATH . "tests/io/storage_dir/");
     foreach ($d->listFiles() as $f) {
         $f->delete(true);
     }
     $this->assertFalse($d->hasSingleSubdir(), "Lo storage e' gia' presente!!");
     $storage = Storage::getPropertiesStorage("boh", "ciccia");
     $this->assertFalse($storage->exists(), "Lo storage esiste gia'!!");
     $test_props = array("test" => "value", "hello" => "world");
     $storage->add("category", $test_props);
     $this->assertTrue($storage->exists(), "Lo storage non e' stato creato!!");
     $storage->delete();
     $this->assertFalse($storage->exists(), "Lo storage non e' stato eliminato!!");
     $properties = $storage->readAll();
     //readAll
     $this->assertTrue($storage->exists(), "Lo storage non e' stato creato per una lettura!!");
     $this->assertFalse($properties === null, "Il risultato ritornato e' ===null !!");
     $this->assertTrue(is_array($properties), "Il metodo non ha ritornato un array con uno storage inesistente!!");
     $this->assertTrue(count($properties) == 0, "L'array ritornato da una lettura di storage vuoto non e' vuoto!!");
     $storage->delete();
     $storage->remove("blah");
     //remove
     $this->assertTrue($storage->exists(), "Lo storage non e' stato creato per una cancellazione!!");
     $storage->delete();
     $storage->saveAll(array());
     //saveAll
     $this->assertTrue($storage->exists(), "Lo storage non e' stato creato per una cancellazione!!");
     $storage->delete();
     $this->assertFalse($storage->exists(), "Lo storage non e' stato eliminato!!");
     foreach ($d->listFiles() as $f) {
         $f->delete(true);
     }
     Storage::set_storage_root(Storage::get_default_storage_root());
 }
開發者ID:mbcraft,項目名稱:frozen,代碼行數:36,代碼來源:storage_test.php

示例2: testHasSingleSubdir

 function testHasSingleSubdir()
 {
     $dir = new Dir("/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/single_subdir/");
     $this->assertTrue($dir->hasSingleSubdir());
     $dir2 = new Dir("/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/content_dir/");
     $this->assertFalse($dir2->hasSingleSubdir());
     $dir3 = new Dir("/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/single_subdir/blablablax/");
     $this->assertFalse($dir3->hasSingleSubdir());
 }
開發者ID:mbcraft,項目名稱:frozen,代碼行數:9,代碼來源:plain_dir_test.php


注:本文中的Dir::hasSingleSubdir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。