moving the configuration changes into the single config class
[CBFWR.git] / unittests / mergetest.php
diff --git a/unittests/mergetest.php b/unittests/mergetest.php
new file mode 100644 (file)
index 0000000..e2d613f
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+$CMD_ROOT_FS = realpath(dirname(__FILE__));
+$AM_DAEMON = false;
+
+global $CMD_ROOT_FS;
+global $AM_DAEMON;
+
+// add libglcas as if it were a path in ../libglcas
+if(file_exists("../libcbfwr")) {
+       $path = realpath($CMD_ROOT_FS."/../");
+       error_log("added cbfwr path as $path");
+       set_include_path(get_include_path().PATH_SEPARATOR.$path);
+}
+
+// include the based library
+require_once("libcbfwr/lib.php");
+
+glcas_pluginLoader();
+
+$config = new Config();
+$comms = new Comms();
+
+$conf1 = $comms->getConfig(0);
+$config->setConfig($conf1);
+$config->addConfigLine("delete hostname");
+$config->addConfigLine("delete zone name internet");
+$conf2 = $config->getConfig();
+
+print_r($conf1);
+print_r($conf2);
+$config->addConfigLine("delete");
+
+?>