stevseea                Wed Mar 19 17:56:10 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/tests/classes      interface_optional_arg_002.phpt 
                                method_override_optional_arg_002.phpt 
                                method_override_optional_arg_001.phpt 

  Modified files:              
    /php-src/tests/classes      array_access_010.phpt array_access_009.phpt 
                                array_access_011.phpt 
  Log:
  Added some class tests; Replaced some hardcoded instance ids with %d.
  
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/array_access_010.phpt?r1=1.1.6.1&r2=1.1.6.2&diff_format=u
Index: php-src/tests/classes/array_access_010.phpt
diff -u php-src/tests/classes/array_access_010.phpt:1.1.6.1 
php-src/tests/classes/array_access_010.phpt:1.1.6.2
--- php-src/tests/classes/array_access_010.phpt:1.1.6.1 Fri Nov  2 19:41:12 2007
+++ php-src/tests/classes/array_access_010.phpt Wed Mar 19 17:56:10 2008
@@ -103,9 +103,9 @@
 string(9) "FooBarBaz"
 ===ArrayOverloading===
 ArrayReferenceProxy::__construct(Array)
-object(ArrayReferenceProxy)#1 (2) {
+object(ArrayReferenceProxy)#%d (2) {
   ["object":"ArrayReferenceProxy":private]=>
-  object(Peoples)#2 (1) {
+  object(Peoples)#%d (1) {
     ["person"]=>
     array(1) {
       [0]=>
@@ -143,9 +143,9 @@
 ArrayReferenceProxy::__construct(Array)
 ArrayReferenceProxy::offsetUnset(Array, name)
 ArrayReferenceProxy::__construct(Array)
-object(ArrayReferenceProxy)#1 (2) {
+object(ArrayReferenceProxy)#%d (2) {
   ["object":"ArrayReferenceProxy":private]=>
-  object(Peoples)#2 (1) {
+  object(Peoples)#%d (1) {
     ["person"]=>
     array(1) {
       [0]=>
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/array_access_009.phpt?r1=1.2.6.1&r2=1.2.6.2&diff_format=u
Index: php-src/tests/classes/array_access_009.phpt
diff -u php-src/tests/classes/array_access_009.phpt:1.2.6.1 
php-src/tests/classes/array_access_009.phpt:1.2.6.2
--- php-src/tests/classes/array_access_009.phpt:1.2.6.1 Fri Nov  2 19:41:12 2007
+++ php-src/tests/classes/array_access_009.phpt Wed Mar 19 17:56:10 2008
@@ -129,9 +129,9 @@
 string(9) "FooBarBaz"
 ===ArrayOverloading===
 ArrayProxy::__construct(0)
-object(ArrayProxy)#1 (2) {
+object(ArrayProxy)#%d (2) {
   ["object":"ArrayProxy":private]=>
-  object(Peoples)#2 (1) {
+  object(Peoples)#%d (1) {
     ["person"]=>
     array(1) {
       [0]=>
@@ -166,9 +166,9 @@
 ArrayProxy::__construct(0)
 ArrayProxy::offsetUnset(0, name)
 ArrayProxy::__construct(0)
-object(ArrayProxy)#1 (2) {
+object(ArrayProxy)#%d (2) {
   ["object":"ArrayProxy":private]=>
-  object(Peoples)#2 (1) {
+  object(Peoples)#%d (1) {
     ["person"]=>
     array(1) {
       [0]=>
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/array_access_011.phpt?r1=1.1.6.1&r2=1.1.6.2&diff_format=u
Index: php-src/tests/classes/array_access_011.phpt
diff -u php-src/tests/classes/array_access_011.phpt:1.1.6.1 
php-src/tests/classes/array_access_011.phpt:1.1.6.2
--- php-src/tests/classes/array_access_011.phpt:1.1.6.1 Fri Nov  2 19:41:12 2007
+++ php-src/tests/classes/array_access_011.phpt Wed Mar 19 17:56:10 2008
@@ -112,9 +112,9 @@
 string(9) "FooBarBaz"
 ===ArrayOverloading===
 ArrayAccessReferenceProxy::__construct(0)
-object(ArrayAccessReferenceProxy)#1 (3) {
+object(ArrayAccessReferenceProxy)#%d (3) {
   ["object":"ArrayAccessReferenceProxy":private]=>
-  object(Peoples)#2 (1) {
+  object(Peoples)#%d (1) {
     ["person"]=>
     &array(1) {
       [0]=>
@@ -157,9 +157,9 @@
 ArrayAccessReferenceProxy::__construct(0)
 ArrayAccessReferenceProxy::offsetUnset(0, name)
 ArrayAccessReferenceProxy::__construct(0)
-object(ArrayAccessReferenceProxy)#1 (3) {
+object(ArrayAccessReferenceProxy)#%d (3) {
   ["object":"ArrayAccessReferenceProxy":private]=>
-  object(Peoples)#2 (1) {
+  object(Peoples)#%d (1) {
     ["person"]=>
     &array(1) {
       [0]=>

http://cvs.php.net/viewvc.cgi/php-src/tests/classes/interface_optional_arg_002.phpt?view=markup&rev=1.1
Index: php-src/tests/classes/interface_optional_arg_002.phpt
+++ php-src/tests/classes/interface_optional_arg_002.phpt
--TEST--
default argument value in interface implementation
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip 
ZendEngine 2 needed'); ?>
--FILE--
<?php

interface test {
        public function bar();
}

class foo implements test {

        public function bar($arg = 2) {
                var_dump($arg);
        }
}

$foo = new foo;
$foo->bar();

?>
--EXPECT--
int(2)
http://cvs.php.net/viewvc.cgi/php-src/tests/classes/method_override_optional_arg_002.phpt?view=markup&rev=1.1
Index: php-src/tests/classes/method_override_optional_arg_002.phpt
+++ php-src/tests/classes/method_override_optional_arg_002.phpt
--TEST--
Omitting optional arg in method inherited from abstract class 
--FILE--
<?php

abstract class A {
        function foo($arg = 1) {}
}

class B extends A {
        function foo() {
                echo "foo\n";
        }
}

$b = new B();
$b->foo();

?>
--EXPECTF--
Fatal error: Declaration of B::foo() must be compatible with that of A::foo() 
in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/tests/classes/method_override_optional_arg_001.phpt?view=markup&rev=1.1
Index: php-src/tests/classes/method_override_optional_arg_001.phpt
+++ php-src/tests/classes/method_override_optional_arg_001.phpt
--TEST--
Method override allows optional default argument
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip 
ZendEngine 2 needed'); ?>
--FILE--
<?php

class A {
        function foo($arg1 = 1) {
        }
}

class B extends A {
        function foo($arg1 = 2, $arg2 = 3) {
                var_dump($arg1);
                var_dump($arg2);
        }
}

class C extends A {
        function foo() {
        }
}

$b = new B();

$b->foo(1);

?>
--EXPECTF--
Fatal error: Declaration of C::foo() must be compatible with that of A::foo() 
in %s on line %d



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to