Пример #1
0
 function testAddEntry()
 {
     $file = new File("/" . FRAMEWORK_CORE_PATH . "tests/io/properties_dir/test_folder_2/add_props.ini");
     if ($file->exists()) {
         $file->delete();
     }
     PropertiesUtils::addEntry($file, true, "prova", array("ciao" => 1, "mondo" => 2, 3 => "pluto"));
     $this->assertTrue($file->exists(), "Il file delle properties non è stato creato!!");
     $props = PropertiesUtils::readFromFile($file, true);
     $this->assertTrue(count($props) == 1, "Il numero delle properties non corrisponde!");
     $entry = $props["prova"];
     $this->assertTrue(count($entry) == 3, "Il numero delle voci non corrisponde!");
     $this->assertEqual($entry["ciao"], 1);
     $this->assertEqual($entry["mondo"], 2);
     $this->assertEqual($entry[3], "pluto");
     $file->delete();
 }
Пример #2
0
 function add($key, $values_array)
 {
     $this->create();
     PropertiesUtils::addEntry($this->storage_file, true, $key, $values_array);
 }