X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2FCatalog.phpt;h=2901da7cdc71f8f81c9902df2b946d80a8d4508e;hb=828a6547cc621fec6fd81745a8f6c9753f904bf2;hp=d5ba180df3b27d612b14d02e0248da53aecbb8f6;hpb=0969cb32a073bdd8ffaf1a647077ac690d430a8d;p=awesomized%2Fext-ion diff --git a/tests/Catalog.phpt b/tests/Catalog.phpt index d5ba180..2901da7 100644 --- a/tests/Catalog.phpt +++ b/tests/Catalog.phpt @@ -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