function set_sector($sector_path, $sector_content, $store_mode = Sector::STORE_MODE_ERROR_ON_OVERWRITE) { Sector::start($sector_path, $store_mode); echo $sector_content; Sector::end(); }
function testSectorPrepend() { Sector::reset(); Sector::start("/ciccia/pluto_prepend"); echo "Ciao!!"; Sector::end(); $this->assertEqual(Sector::get("/ciccia/pluto_prepend"), "Ciao!!", "I dati non sono stati memorizzati correttamente nel settore!!"); try { Sector::start("/ciccia/pluto_prepend", Sector::STORE_MODE_PREPEND); echo "Mondo!!"; Sector::end(); $this->assertEqual(Sector::get("/ciccia/pluto_prepend"), "Mondo!!Ciao!!", "I dati non sono stati memorizzati correttamente nel settore!!"); } catch (Exception $ex) { Sector::reset(); $this->fail("Errore durante un prepend!! con STORE_MODE_PREPEND !!"); } }