unfold cookie tests and fix variable type inconsitency
[m6w6/ext-http] / tests / cookie007.phpt
diff --git a/tests/cookie007.phpt b/tests/cookie007.phpt
new file mode 100644 (file)
index 0000000..1a7a4c3
--- /dev/null
@@ -0,0 +1,37 @@
+--TEST--
+cookies max-age
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+echo "Test\n";
+
+$c = new http\Cookie("this=max-age; max-age=12345");
+var_dump($c->getCookie("this"));
+var_dump($c->getMaxAge());
+$o = clone $c;
+$t = 54321;
+$o->setMaxAge();
+var_dump($o->getMaxAge());
+var_dump(-1 != $c->getMaxAge());
+$o->setMaxAge($t);
+var_dump($o->getMaxAge());
+var_dump($t != $c->getMaxAge());
+var_dump($o->toString());
+
+?>
+DONE
+--EXPECT--
+Test
+string(7) "max-age"
+int(12345)
+int(-1)
+bool(true)
+int(54321)
+bool(true)
+string(29) "this=max-age; max-age=54321; "
+DONE