summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Fernandes <robinf@php.net>2008-05-23 21:14:07 +0000
committerRobin Fernandes <robinf@php.net>2008-05-23 21:14:07 +0000
commitd2d61cac19a5151a7831fe2a921787edcc05217d (patch)
treeb5ab9639363a3b51626516502e7ccaa0c7d80495
parente1cb67310ca880888e0182e706487a753b07ca71 (diff)
downloadphp-git-d2d61cac19a5151a7831fe2a921787edcc05217d.tar.gz
More basic ReflectionClass tests from Dutch TestFest.
-rw-r--r--ext/reflection/tests/reflectionClass_getExtensionName_basic.phpt14
-rw-r--r--ext/reflection/tests/reflectionClass_getExtensionName_variation.phpt20
-rw-r--r--ext/reflection/tests/reflectionClass_getExtension_basic.phpt17
-rw-r--r--ext/reflection/tests/reflectionClass_getExtension_variation.phpt20
-rw-r--r--ext/reflection/tests/reflectionClass_getInterfaceNames_basic.phpt25
-rw-r--r--ext/reflection/tests/reflectionClass_getModifiers_basic.phpt2
-rw-r--r--ext/reflection/tests/reflectionClass_getParentClass.phpt2
-rw-r--r--ext/reflection/tests/reflectionClass_hasConstant_basic.phpt4
-rw-r--r--ext/reflection/tests/reflectionClass_hasMethod_basic.phpt4
-rw-r--r--ext/reflection/tests/reflectionClass_hasProperty_basic.phpt4
-rw-r--r--ext/reflection/tests/reflectionClass_isAbstract_basic.phpt23
-rw-r--r--ext/reflection/tests/reflectionClass_isFinal_basic.phpt23
-rw-r--r--ext/reflection/tests/reflectionClass_isInterface_basic.phpt2
-rw-r--r--ext/reflection/tests/reflectionClass_isIterateable_basic.phpt2
-rw-r--r--ext/reflection/tests/reflectionClass_isIterateable_variation1.phpt2
15 files changed, 157 insertions, 7 deletions
diff --git a/ext/reflection/tests/reflectionClass_getExtensionName_basic.phpt b/ext/reflection/tests/reflectionClass_getExtensionName_basic.phpt
new file mode 100644
index 0000000000..7813cca315
--- /dev/null
+++ b/ext/reflection/tests/reflectionClass_getExtensionName_basic.phpt
@@ -0,0 +1,14 @@
+--TEST--
+ReflectionClass::getExtensionName() method - basic test for getExtensionName() method
+--SKIPIF--
+<?php extension_loaded('reflection') && extension_loaded('dom') or die('skip - reflection or dom extension not loaded'); ?>
+--CREDITS--
+Rein Velt <rein@velt.org>
+#testFest Roosendaal 2008-05-10
+--FILE--
+<?php
+ $rc=new reflectionClass('domDocument');
+ var_dump( $rc->getExtensionName()) ;
+?>
+--EXPECT--
+string(3) "dom"
diff --git a/ext/reflection/tests/reflectionClass_getExtensionName_variation.phpt b/ext/reflection/tests/reflectionClass_getExtensionName_variation.phpt
new file mode 100644
index 0000000000..35372c4f84
--- /dev/null
+++ b/ext/reflection/tests/reflectionClass_getExtensionName_variation.phpt
@@ -0,0 +1,20 @@
+--TEST--
+ReflectionClass::getExtensionName() method - variation test for getExtensionName()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
+Rein Velt <rein@velt.org>
+#testFest Roosendaal 2008-05-10
+--FILE--
+<?php
+
+ class myClass
+ {
+ public $varX;
+ public $varY;
+ }
+ $rc=new reflectionClass('myClass');
+ var_dump( $rc->getExtensionName()) ;
+?>
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/ext/reflection/tests/reflectionClass_getExtension_basic.phpt b/ext/reflection/tests/reflectionClass_getExtension_basic.phpt
new file mode 100644
index 0000000000..efc1ed8eed
--- /dev/null
+++ b/ext/reflection/tests/reflectionClass_getExtension_basic.phpt
@@ -0,0 +1,17 @@
+--TEST--
+ReflectionClass::getExtension() method - basic test for getExtension() method
+--SKIPIF--
+<?php extension_loaded('reflection') && extension_loaded('dom') or die('skip - reflection or dom extension not loaded'); ?>
+--CREDITS--
+Rein Velt <rein@velt.org>
+#testFest Roosendaal 2008-05-10
+--FILE--
+<?php
+ $rc=new reflectionClass('domDocument');
+ var_dump($rc->getExtension()) ;
+?>
+--EXPECTF--
+object(ReflectionExtension)#%d (1) {
+ ["name"]=>
+ string(3) "dom"
+} \ No newline at end of file
diff --git a/ext/reflection/tests/reflectionClass_getExtension_variation.phpt b/ext/reflection/tests/reflectionClass_getExtension_variation.phpt
new file mode 100644
index 0000000000..f2272777a0
--- /dev/null
+++ b/ext/reflection/tests/reflectionClass_getExtension_variation.phpt
@@ -0,0 +1,20 @@
+--TEST--
+ReflectionClass::getExtension() method - variation test for getExtension()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
+Rein Velt <rein@velt.org>
+#testFest Roosendaal 2008-05-10
+--FILE--
+<?php
+
+ class myClass
+ {
+ public $varX;
+ public $varY;
+ }
+ $rc=new reflectionClass('myClass');
+ var_dump( $rc->getExtension()) ;
+?>
+--EXPECT--
+NULL \ No newline at end of file
diff --git a/ext/reflection/tests/reflectionClass_getInterfaceNames_basic.phpt b/ext/reflection/tests/reflectionClass_getInterfaceNames_basic.phpt
new file mode 100644
index 0000000000..abbaa35f5c
--- /dev/null
+++ b/ext/reflection/tests/reflectionClass_getInterfaceNames_basic.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ReflectionClass::getInterfaceNames()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
+Michelangelo van Dam <dragonbe@gmail.com>
+#testfest roosendaal on 2008-05-10
+--FILE--
+<?php
+interface Foo { }
+
+interface Bar { }
+
+class Baz implements Foo, Bar { }
+
+$rc1 = new ReflectionClass("Baz");
+var_dump($rc1->getInterfaceNames());
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ string(3) "Foo"
+ [1]=>
+ string(3) "Bar"
+}
diff --git a/ext/reflection/tests/reflectionClass_getModifiers_basic.phpt b/ext/reflection/tests/reflectionClass_getModifiers_basic.phpt
index 5d2592d17e..fad4e318c3 100644
--- a/ext/reflection/tests/reflectionClass_getModifiers_basic.phpt
+++ b/ext/reflection/tests/reflectionClass_getModifiers_basic.phpt
@@ -1,7 +1,7 @@
--TEST--
ReflectionClass::getModifiers()
--SKIPIF--
-<?php extension_loaded('reflection') or die('skip'); ?>
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
diff --git a/ext/reflection/tests/reflectionClass_getParentClass.phpt b/ext/reflection/tests/reflectionClass_getParentClass.phpt
index 46884ca2ba..c73aeaa84e 100644
--- a/ext/reflection/tests/reflectionClass_getParentClass.phpt
+++ b/ext/reflection/tests/reflectionClass_getParentClass.phpt
@@ -1,5 +1,7 @@
--TEST--
ReflectionClass::getParentClass()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
--CREDITS--
Michelangelo van Dam <dragonbe@gmail.com>
#testfest roosendaal on 2008-05-10
diff --git a/ext/reflection/tests/reflectionClass_hasConstant_basic.phpt b/ext/reflection/tests/reflectionClass_hasConstant_basic.phpt
index 49570150c7..75d3d30e78 100644
--- a/ext/reflection/tests/reflectionClass_hasConstant_basic.phpt
+++ b/ext/reflection/tests/reflectionClass_hasConstant_basic.phpt
@@ -1,6 +1,8 @@
--TEST--
ReflectionClass::hasConstant()
---CREDIT--
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
Marc Veldman <marc@ibuildings.nl>
#testfest roosendaal on 2008-05-10
--FILE--
diff --git a/ext/reflection/tests/reflectionClass_hasMethod_basic.phpt b/ext/reflection/tests/reflectionClass_hasMethod_basic.phpt
index 3ef5ac9202..700218951f 100644
--- a/ext/reflection/tests/reflectionClass_hasMethod_basic.phpt
+++ b/ext/reflection/tests/reflectionClass_hasMethod_basic.phpt
@@ -1,6 +1,8 @@
--TEST--
ReflectionClass::hasMethod()
---CREDIT--
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
Marc Veldman <marc@ibuildings.nl>
#testfest roosendaal on 2008-05-10
--FILE--
diff --git a/ext/reflection/tests/reflectionClass_hasProperty_basic.phpt b/ext/reflection/tests/reflectionClass_hasProperty_basic.phpt
index b3264e01ed..26ca6a4cd5 100644
--- a/ext/reflection/tests/reflectionClass_hasProperty_basic.phpt
+++ b/ext/reflection/tests/reflectionClass_hasProperty_basic.phpt
@@ -1,6 +1,8 @@
--TEST--
ReflectionClass::hasProperty()
---CREDIT--
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
Marc Veldman <marc@ibuildings.nl>
#testfest roosendaal on 2008-05-10
--FILE--
diff --git a/ext/reflection/tests/reflectionClass_isAbstract_basic.phpt b/ext/reflection/tests/reflectionClass_isAbstract_basic.phpt
new file mode 100644
index 0000000000..7a3d577ef6
--- /dev/null
+++ b/ext/reflection/tests/reflectionClass_isAbstract_basic.phpt
@@ -0,0 +1,23 @@
+--TEST--
+ReflectionClass::isAbstract() method
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
+Felix De Vliegher <felix.devliegher@gmail.com>
+#testfest roosendaal on 2008-05-10
+--FILE--
+<?php
+
+class TestClass {}
+abstract class TestAbstractClass {}
+
+$testClass = new ReflectionClass('TestClass');
+$abstractClass = new ReflectionClass('TestAbstractClass');
+
+var_dump($testClass->isAbstract());
+var_dump($abstractClass->isAbstract());
+
+?>
+--EXPECT--
+bool(false)
+bool(true)
diff --git a/ext/reflection/tests/reflectionClass_isFinal_basic.phpt b/ext/reflection/tests/reflectionClass_isFinal_basic.phpt
new file mode 100644
index 0000000000..efa131724e
--- /dev/null
+++ b/ext/reflection/tests/reflectionClass_isFinal_basic.phpt
@@ -0,0 +1,23 @@
+--TEST--
+ReflectionClass::isFinal() method
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
+--CREDITS--
+Felix De Vliegher <felix.devliegher@gmail.com>
+#testfest roosendaal on 2008-05-10
+--FILE--
+<?php
+
+class TestClass {}
+final class TestFinalClass {}
+
+$normalClass = new ReflectionClass('TestClass');
+$finalClass = new ReflectionClass('TestFinalClass');
+
+var_dump($normalClass->isFinal());
+var_dump($finalClass->isFinal());
+
+?>
+--EXPECT--
+bool(false)
+bool(true)
diff --git a/ext/reflection/tests/reflectionClass_isInterface_basic.phpt b/ext/reflection/tests/reflectionClass_isInterface_basic.phpt
index 2870725e83..2e5c6302d8 100644
--- a/ext/reflection/tests/reflectionClass_isInterface_basic.phpt
+++ b/ext/reflection/tests/reflectionClass_isInterface_basic.phpt
@@ -1,7 +1,7 @@
--TEST--
ReflectionClass::isInterface() method
--SKIPIF--
-<?php extension_loaded('reflection') or die('skip'); ?>
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>
#testfest roosendaal on 2008-05-10
diff --git a/ext/reflection/tests/reflectionClass_isIterateable_basic.phpt b/ext/reflection/tests/reflectionClass_isIterateable_basic.phpt
index 3e1228af25..cfcf799e38 100644
--- a/ext/reflection/tests/reflectionClass_isIterateable_basic.phpt
+++ b/ext/reflection/tests/reflectionClass_isIterateable_basic.phpt
@@ -1,7 +1,7 @@
--TEST--
ReflectionClass::isIterateable() basic
--SKIPIF--
-<?php extension_loaded('reflection') or die('skip'); ?>
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>, Marc Veldman <marc@ibuildings.nl>
--FILE--
diff --git a/ext/reflection/tests/reflectionClass_isIterateable_variation1.phpt b/ext/reflection/tests/reflectionClass_isIterateable_variation1.phpt
index 6d737bb893..654a37ec99 100644
--- a/ext/reflection/tests/reflectionClass_isIterateable_variation1.phpt
+++ b/ext/reflection/tests/reflectionClass_isIterateable_variation1.phpt
@@ -1,7 +1,7 @@
--TEST--
ReflectionClass::isIterateable() variations
--SKIPIF--
-<?php extension_loaded('reflection') or die('skip'); ?>
+<?php extension_loaded('reflection') or die('skip - reflection extension not loaded'); ?>
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--