cvs: ZendEngine2 /tests class_constants_004.phpt objects_017.phpt objects_018.phpt

[email protected] ("Felipe Pena")
Newsgroups php.zend-engine.cvs
Message-ID <cvsfelipe1205248898@cvsserver>
felipe		Tue Mar 11 15:21:38 2008 UTC

  Modified files:              
    /ZendEngine2/tests	objects_017.phpt objects_018.phpt 
                      	class_constants_004.phpt 
  Log:
  New tests
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/objects_017.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/objects_017.phpt
diff -u /dev/null ZendEngine2/tests/objects_017.phpt:1.2
--- /dev/null	Tue Mar 11 15:21:38 2008
+++ ZendEngine2/tests/objects_017.phpt	Tue Mar 11 15:21:38 2008
@@ -0,0 +1,18 @@
+--TEST--
+Testing visibility of object returned by function
+--FILE--
+<?php
+
+class foo {
+	private $test = 1;
+}
+
+function test() {
+	return new foo;
+}
+
+test()->test = 2;
+
+?>
+--EXPECTF--
+Fatal error: Cannot access private property foo::$test in %s on line %d
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/objects_018.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/objects_018.phpt
diff -u /dev/null ZendEngine2/tests/objects_018.phpt:1.2
--- /dev/null	Tue Mar 11 15:21:38 2008
+++ ZendEngine2/tests/objects_018.phpt	Tue Mar 11 15:21:38 2008
@@ -0,0 +1,19 @@
+--TEST--
+Using the same function name on interface with inheritance
+--FILE--
+<?php
+
+interface Itest {
+	function a();
+}
+
+interface Itest2 {
+	function a();
+}
+
+interface Itest3 extends Itest, Itest2 {
+}
+
+?>
+--EXPECTF--
+Fatal error: Can't inherit abstract function Itest2::a() (previously declared abstract in Itest) in %s on line %d
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/class_constants_004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/class_constants_004.phpt
diff -u /dev/null ZendEngine2/tests/class_constants_004.phpt:1.2
--- /dev/null	Tue Mar 11 15:21:38 2008
+++ ZendEngine2/tests/class_constants_004.phpt	Tue Mar 11 15:21:38 2008
@@ -0,0 +1,42 @@
+--TEST--
+Testing constants (normal, namespace, class and interface)
+--FILE--
+<?php
+
+namespace foo;
+
+define('foo', 3);
+
+const foo = 1;
+
+class foo {
+	const foo = 2;
+}
+
+interface Ifoo {
+	const foo = 4;
+}
+
+$const  = __NAMESPACE__ .'::foo';  // class
+$const2 = __NAMESPACE__ .'::Ifoo'; // interface
+
+var_dump(	foo,
+			foo::foo, 
+			namespace::foo, 
+			foo::foo::foo, 
+			$const::foo,
+			::foo,
+			constant('foo'),
+			Ifoo::foo			
+			);
+
+?>
+--EXPECT--
+int(1)
+int(1)
+int(1)
+int(2)
+int(2)
+int(3)
+int(3)
+int(4)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.