fix #6: compatibility with 8.2
[awesomized/ext-ion] / tests / Catalog.phpt
index d5ba180df3b27d612b14d02e0248da53aecbb8f6..2901da7cdc71f8f81c9902df2b946d80a8d4508e 100644 (file)
@@ -8,7 +8,7 @@ TEST
 
 $c = new ion\Catalog;
 var_dump(count($c));
-$c->add(ion\Symbol\Table\PHP());
+$c->add($php = ion\Symbol\PHP::asTable());
 var_dump(count($c));
 $c->add(new ion\Symbol\Table\Shared("shared", 1, ["foo", "bar", "baz"]));
 var_dump(count($c));
@@ -22,6 +22,15 @@ var_dump($c->findBest("shared"));
 
 $c->remove("shared");
 var_dump(count($c));
+
+var_dump($d = clone $c);
+$c->remove($php);
+$c->remove($php);
+unset($c);
+var_dump(count($d));
+var_dump($d->find("PHP", 1));
+$d->remove($php);
+var_dump(count($d));
 ?>
 DONE
 --EXPECTF--
@@ -114,4 +123,20 @@ object(ion\Symbol\Table\Shared)#%d (3) {
   }
 }
 int(1)
+object(ion\Catalog)#%d (1) {
+  ["symbolTables":"ion\Catalog":private]=>
+  array(0) {
+  }
+}
+int(1)
+object(ion\Symbol\Table\Shared)#%d (3) {
+  ["name"]=>
+  string(3) "PHP"
+  ["version"]=>
+  int(1)
+  ["symbols":"ion\Symbol\Table\Shared":private]=>
+  array(0) {
+  }
+}
+int(0)
 DONE