]> granicus.if.org Git - php/commitdiff
Add two regression tests for the session module
authorSascha Schumann <sas@php.net>
Sun, 24 Dec 2000 15:57:05 +0000 (15:57 +0000)
committerSascha Schumann <sas@php.net>
Sun, 24 Dec 2000 15:57:05 +0000 (15:57 +0000)
ext/session/tests/001.phpt [new file with mode: 0644]
ext/session/tests/002.phpt [new file with mode: 0644]

diff --git a/ext/session/tests/001.phpt b/ext/session/tests/001.phpt
new file mode 100644 (file)
index 0000000..aac17cb
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Session Object Serialization
+--FILE--
+<?
+
+class foo {
+       var $bar = "ok";
+
+       function method() { $this->yes = "done"; }
+}
+
+$baz = new foo;
+$baz->method();
+
+$arr[3] = new foo;
+$arr[3]->method();
+
+session_register("baz");
+session_register("arr");
+
+print session_encode()."\n";
+
+session_destroy();
+--GET--
+--POST--
+--EXPECT--
+baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}
diff --git a/ext/session/tests/002.phpt b/ext/session/tests/002.phpt
new file mode 100644 (file)
index 0000000..60ece0d
--- /dev/null
@@ -0,0 +1,10 @@
+--TEST--
+session_unset() without any session
+--FILE--
+<?
+session_unset();
+print "ok\n";
+--GET--
+--POST--
+--EXPECT--
+ok