cvs: ZendEngine2(PHP_5_3) /tests get_class_methods_001.phpt get_class_methods_002.phpt get_class_methods_003.phpt
"Felipe Pena" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.zend |
|---|---|
| Message-ID | <cvsfelipe1219412409@cvsserver> |
felipe Fri Aug 22 13:40:09 2008 UTC
Added files: (Branch: PHP_5_3)
/ZendEngine2/tests get_class_methods_001.phpt
get_class_methods_002.phpt
get_class_methods_003.phpt
Log:
- New tests
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/get_class_methods_001.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/get_class_methods_001.phpt
+++ ZendEngine2/tests/get_class_methods_001.phpt
--TEST--
get_class_methods(): Testing scope
--FILE--
<?php
abstract class A {
public function a() { }
private function b() { }
protected function c() { }
}
class B extends A {
private function bb() { }
static public function test() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
}
}
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
B::test();
?>
--EXPECT--
array(1) {
[0]=>
unicode(1) "a"
}
array(2) {
[0]=>
unicode(4) "test"
[1]=>
unicode(1) "a"
}
array(2) {
[0]=>
unicode(1) "a"
[1]=>
unicode(1) "c"
}
array(4) {
[0]=>
unicode(2) "bb"
[1]=>
unicode(4) "test"
[2]=>
unicode(1) "a"
[3]=>
unicode(1) "c"
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/get_class_methods_002.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/get_class_methods_002.phpt
+++ ZendEngine2/tests/get_class_methods_002.phpt
--TEST--
get_class_methods(): Testing with interface
--FILE--
<?php
interface A {
function a();
function b();
}
class B implements A {
public function a() { }
public function b() { }
public function __construct() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
}
public function __destruct() { }
}
new B;
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class B in %s on line %d
array(2) {
[0]=>
unicode(1) "a"
[1]=>
unicode(1) "b"
}
array(4) {
[0]=>
unicode(1) "a"
[1]=>
unicode(1) "b"
[2]=>
unicode(11) "__construct"
[3]=>
unicode(10) "__destruct"
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/get_class_methods_003.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/get_class_methods_003.phpt
+++ ZendEngine2/tests/get_class_methods_003.phpt
--TEST--
get_class_methods(): Testing scope
--FILE--
<?php
interface A {
function aa();
function bb();
static function cc();
}
class C {
public function a() { }
protected function b() { }
private function c() { }
static public function static_a() { }
static protected function static_b() { }
static private function static_c() { }
}
class B extends C implements A {
public function aa() { }
public function bb() { }
static function cc() { }
public function __construct() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
var_dump(get_class_methods('C'));
}
public function __destruct() { }
}
new B;
?>
--EXPECT--
array(3) {
[0]=>
unicode(2) "aa"
[1]=>
unicode(2) "bb"
[2]=>
unicode(2) "cc"
}
array(9) {
[0]=>
unicode(2) "aa"
[1]=>
unicode(2) "bb"
[2]=>
unicode(2) "cc"
[3]=>
unicode(11) "__construct"
[4]=>
unicode(10) "__destruct"
[5]=>
unicode(1) "a"
[6]=>
unicode(1) "b"
[7]=>
unicode(8) "static_a"
[8]=>
unicode(8) "static_b"
}
array(4) {
[0]=>
unicode(1) "a"
[1]=>
unicode(1) "b"
[2]=>
unicode(8) "static_a"
[3]=>
unicode(8) "static_b"
}
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php