X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2F002.phpt;fp=tests%2F002.phpt;h=95c9c02088dc53330f37570dc5789d41e9d1dbdd;hb=2c51ec0453e42ad990e16435542619ce62a778ab;hp=0000000000000000000000000000000000000000;hpb=15085c3c0f03f8b01b1362eb041aac23afc51b70;p=m6w6%2Fext-propro diff --git a/tests/002.phpt b/tests/002.phpt new file mode 100644 index 0000000..95c9c02 --- /dev/null +++ b/tests/002.phpt @@ -0,0 +1,100 @@ +--TEST-- +property proxy +--SKIPIF-- + +--FILE-- +storage, $p); + } + function __set($p, $v) { + $this->storage[$p] = $v; + } +} + +$c = new c; +$c->data["foo"] = 1; +var_dump( + isset($c->data["foo"]), + isset($c->data["bar"]) +); + +var_dump($c); + +$c->data[] = 1; +$c->data[] = 2; +$c->data[] = 3; +$c->data["bar"][] = 123; +$c->data["bar"][] = 456; + +var_dump($c); +unset($c->data["bar"][0]); + +var_dump($c); + +?> +DONE +--EXPECTF-- +Test +bool(true) +bool(false) +object(c)#%d (1) { + ["storage":"c":private]=> + array(1) { + ["data"]=> + array(1) { + ["foo"]=> + int(1) + } + } +} +object(c)#%d (1) { + ["storage":"c":private]=> + array(1) { + ["data"]=> + array(5) { + ["foo"]=> + int(1) + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + ["bar"]=> + array(2) { + [0]=> + int(123) + [1]=> + int(456) + } + } + } +} +object(c)#%d (1) { + ["storage":"c":private]=> + array(1) { + ["data"]=> + array(5) { + ["foo"]=> + int(1) + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + ["bar"]=> + array(1) { + [1]=> + int(456) + } + } + } +} +DONE