robinf Wed Jun 17 10:38:24 2009 UTC
Modified files:
/php-src/tests/classes static_properties_undeclared_assignRef.phpt
static_properties_undeclared_assign.phpt
interface_optional_arg_003.phpt
iterators_008.phpt
static_properties_undeclared_assignInc.phpt
static_properties_undeclared_inc.phpt
interface_optional_arg_003.inc
static_properties_undeclared_read.phpt
static_properties_undeclared_isset.phpt
Log:
Additional class related tests.
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/static_properties_undeclared_assignRef.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/static_properties_undeclared_assignRef.phpt
diff -u /dev/null
php-src/tests/classes/static_properties_undeclared_assignRef.phpt:1.2
--- /dev/null Wed Jun 17 10:38:23 2009
+++ php-src/tests/classes/static_properties_undeclared_assignRef.phpt Wed Jun
17 10:38:23 2009
@@ -0,0 +1,10 @@
+--TEST--
+Assigning a non-existent static property by reference
+--FILE--
+<?php
+Class C {}
+$a = 'foo';
+C::$p =& $a;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 4
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/static_properties_undeclared_assign.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/static_properties_undeclared_assign.phpt
diff -u /dev/null
php-src/tests/classes/static_properties_undeclared_assign.phpt:1.2
--- /dev/null Wed Jun 17 10:38:23 2009
+++ php-src/tests/classes/static_properties_undeclared_assign.phpt Wed Jun
17 10:38:23 2009
@@ -0,0 +1,9 @@
+--TEST--
+Assigning to a non-existent static property
+--FILE--
+<?php
+Class C {}
+C::$p = 1;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/interface_optional_arg_003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/interface_optional_arg_003.phpt
diff -u /dev/null php-src/tests/classes/interface_optional_arg_003.phpt:1.2
--- /dev/null Wed Jun 17 10:38:23 2009
+++ php-src/tests/classes/interface_optional_arg_003.phpt Wed Jun 17
10:38:23 2009
@@ -0,0 +1,17 @@
+--TEST--
+default argument value in and in implementing class with interface in included
file
+--FILE--
+<?php
+include 'interface_optional_arg_003.inc';
+
+class C implements I {
+ function f($a = 2) {
+ var_dump($a);
+ }
+}
+
+$c = new C;
+$c->f();
+?>
+--EXPECTF--
+int(2)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/iterators_008.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/iterators_008.phpt
diff -u /dev/null php-src/tests/classes/iterators_008.phpt:1.2
--- /dev/null Wed Jun 17 10:38:23 2009
+++ php-src/tests/classes/iterators_008.phpt Wed Jun 17 10:38:23 2009
@@ -0,0 +1,45 @@
+--TEST--
+Ensure plain userspace superclass does not override special iterator behaviour
on child class.
+--FILE--
+<?php
+Class C {}
+
+class D extends C implements Iterator {
+
+ private $counter = 2;
+
+ public function valid() {
+ echo __METHOD__ . "($this->counter)\n";
+ return $this->counter;
+ }
+
+ public function next() {
+ $this->counter--;
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+ public function rewind() {
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+ public function current() {
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+ public function key() {
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+}
+
+foreach (new D as $x) {}
+?>
+--EXPECTF--
+D::rewind(2)
+D::valid(2)
+D::current(2)
+D::next(1)
+D::valid(1)
+D::current(1)
+D::next(0)
+D::valid(0)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/static_properties_undeclared_assignInc.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/static_properties_undeclared_assignInc.phpt
diff -u /dev/null
php-src/tests/classes/static_properties_undeclared_assignInc.phpt:1.2
--- /dev/null Wed Jun 17 10:38:23 2009
+++ php-src/tests/classes/static_properties_undeclared_assignInc.phpt Wed Jun
17 10:38:23 2009
@@ -0,0 +1,9 @@
+--TEST--
+Assigning & incrementing a non-existent static property
+--FILE--
+<?php
+Class C {}
+C::$p += 1;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/static_properties_undeclared_inc.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/static_properties_undeclared_inc.phpt
diff -u /dev/null
php-src/tests/classes/static_properties_undeclared_inc.phpt:1.2
--- /dev/null Wed Jun 17 10:38:24 2009
+++ php-src/tests/classes/static_properties_undeclared_inc.phpt Wed Jun 17
10:38:23 2009
@@ -0,0 +1,9 @@
+--TEST--
+Incrementing a non-existent static property
+--FILE--
+<?php
+Class C {}
+C::$p++;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/interface_optional_arg_003.inc?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/interface_optional_arg_003.inc
diff -u /dev/null php-src/tests/classes/interface_optional_arg_003.inc:1.2
--- /dev/null Wed Jun 17 10:38:24 2009
+++ php-src/tests/classes/interface_optional_arg_003.inc Wed Jun 17
10:38:23 2009
@@ -0,0 +1,4 @@
+<?php
+interface I {
+ function f($a = null);
+}
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/static_properties_undeclared_read.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/static_properties_undeclared_read.phpt
diff -u /dev/null
php-src/tests/classes/static_properties_undeclared_read.phpt:1.2
--- /dev/null Wed Jun 17 10:38:24 2009
+++ php-src/tests/classes/static_properties_undeclared_read.phpt Wed Jun
17 10:38:23 2009
@@ -0,0 +1,9 @@
+--TEST--
+Reading a non-existent static property
+--FILE--
+<?php
+Class C {}
+echo C::$p;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/static_properties_undeclared_isset.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/classes/static_properties_undeclared_isset.phpt
diff -u /dev/null
php-src/tests/classes/static_properties_undeclared_isset.phpt:1.2
--- /dev/null Wed Jun 17 10:38:24 2009
+++ php-src/tests/classes/static_properties_undeclared_isset.phpt Wed Jun
17 10:38:23 2009
@@ -0,0 +1,9 @@
+--TEST--
+Issetting a non-existent static property
+--FILE--
+<?php
+Class C {}
+var_dump(isset(C::$p));
+?>
+--EXPECTF--
+bool(false)
\ No newline at end of file
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php