summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-01-30 22:33:17 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-01-30 22:50:25 +0100
commita8d901a80c307d788abdffac8768d5cd51b6105e (patch)
tree64fc7861496c6374c9a8e967f936508f7be749a9 /ext
parentdf404eccb57b58fdcfada0a2424904fac38a2ec4 (diff)
downloadphp-git-a8d901a80c307d788abdffac8768d5cd51b6105e.tar.gz
Remove zend_version() checks from tests
Diffstat (limited to 'ext')
-rw-r--r--ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt20
-rw-r--r--ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt61
-rw-r--r--ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt30
-rw-r--r--ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt61
-rw-r--r--ext/standard/tests/array/array_fill_object.phpt10
-rw-r--r--ext/standard/tests/array/array_fill_object_2_4.phpt434
-rw-r--r--ext/standard/tests/class_object/is_a.phpt2
-rw-r--r--ext/standard/tests/serialize/bug26762.phpt1
-rw-r--r--ext/standard/tests/strings/bug24281.phpt4
9 files changed, 14 insertions, 609 deletions
diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt
index ffd81ffb87..ab8afb8cb9 100644
--- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt
+++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt
@@ -3,8 +3,6 @@ ReflectionClass::getStaticPropertyValue()
--CREDITS--
Robin Fernandes <robinf@php.net>
Steve Seear <stevseea@php.net>
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.4.0', '>=')) die('skip ZendEngine 2.3 or below needed'); ?>
--FILE--
<?php
class A {
@@ -53,17 +51,9 @@ try {
--EXPECTF--
Retrieving static values from A:
string(13) "default value"
-string(16) "original private"
-string(13) "default value"
-string(18) "original protected"
-string(15) "original public"
-
-Retrieving static values from B:
-string(16) "original private"
-string(15) "changed private"
-string(17) "changed protected"
-string(14) "changed public"
-Retrieving non-existent values from A with no default value:
-Class A does not have a property named protectedOverridden
-Class A does not have a property named privateOverridden
+Fatal error: Uncaught ReflectionException: Class A does not have a property named in %s:%d
+Stack trace:
+#0 %s(%d): ReflectionClass->getStaticPropertyValue('\x00A\x00privateOverr...')
+#1 {main}
+ thrown in %s on line %d
diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt
deleted file mode 100644
index 02f7595cb4..0000000000
--- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt
+++ /dev/null
@@ -1,61 +0,0 @@
---TEST--
-ReflectionClass::getStaticPropertyValue()
---CREDITS--
-Robin Fernandes <robinf@php.net>
-Steve Seear <stevseea@php.net>
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?>
---FILE--
-<?php
-class A {
- static private $privateOverridden = "original private";
- static protected $protectedOverridden = "original protected";
- static public $publicOverridden = "original public";
-}
-
-class B extends A {
- static private $privateOverridden = "changed private";
- static protected $protectedOverridden = "changed protected";
- static public $publicOverridden = "changed public";
-}
-
-echo "Retrieving static values from A:\n";
-$rcA = new ReflectionClass('A');
-var_dump($rcA->getStaticPropertyValue("privateOverridden", "default value"));
-var_dump($rcA->getStaticPropertyValue("\0A\0privateOverridden"));
-var_dump($rcA->getStaticPropertyValue("protectedOverridden", "default value"));
-var_dump($rcA->getStaticPropertyValue("\0*\0protectedOverridden"));
-var_dump($rcA->getStaticPropertyValue("publicOverridden"));
-
-echo "\nRetrieving static values from B:\n";
-$rcB = new ReflectionClass('B');
-var_dump($rcB->getStaticPropertyValue("\0A\0privateOverridden"));
-var_dump($rcB->getStaticPropertyValue("\0B\0privateOverridden"));
-var_dump($rcB->getStaticPropertyValue("\0*\0protectedOverridden"));
-var_dump($rcB->getStaticPropertyValue("publicOverridden"));
-
-echo "\nRetrieving non-existent values from A with no default value:\n";
-try {
- var_dump($rcA->getStaticPropertyValue("protectedOverridden"));
- echo "you should not see this";
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
-}
-
-try {
- var_dump($rcA->getStaticPropertyValue("privateOverridden"));
- echo "you should not see this";
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
-}
-
-?>
---EXPECTF--
-Retrieving static values from A:
-string(13) "default value"
-
-Fatal error: Uncaught ReflectionException: Class A does not have a property named in %sReflectionClass_getStaticPropertyValue_001_2_4.php:%d
-Stack trace:
-#0 %sReflectionClass_getStaticPropertyValue_001_2_4.php(%d): ReflectionClass->getStaticPropertyValue('\x00A\x00privateOverr...')
-#1 {main}
- thrown in %sReflectionClass_getStaticPropertyValue_001_2_4.php on line %d
diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt
index 9e8f01e679..0004f3ff5a 100644
--- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt
+++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt
@@ -3,8 +3,6 @@ ReflectionClass::setStaticPropertyValue()
--CREDITS--
Robin Fernandes <robinf@php.net>
Steve Seear <stevseea@php.net>
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.4.0', '>=')) die('skip ZendEngine 2.3 or below needed'); ?>
--FILE--
<?php
class A {
@@ -53,27 +51,9 @@ try {
?>
--EXPECTF--
Set static values in A:
-Array
-(
- [privateOverridden] => new value 1
- [protectedOverridden] => new value 2
- [publicOverridden] => new value 3
-)
-Set static values in B:
-Array
-(
- [privateOverridden] => new value 4
- [protectedOverridden] => new value 2
- [publicOverridden] => new value 3
-)
-Array
-(
- [privateOverridden] => new value 5
- [protectedOverridden] => new value 6
- [publicOverridden] => new value 7
-)
-
-Set non-existent values from A with no default value:
-Class A does not have a property named protectedOverridden
-Class A does not have a property named privateOverridden
+Fatal error: Uncaught ReflectionException: Class A does not have a property named in %s:%d
+Stack trace:
+#0 %s(%d): ReflectionClass->setStaticPropertyValue('\x00A\x00privateOverr...', 'new value 1')
+#1 {main}
+ thrown in %s on line %d
diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt
deleted file mode 100644
index 6720d2daa2..0000000000
--- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt
+++ /dev/null
@@ -1,61 +0,0 @@
---TEST--
-ReflectionClass::setStaticPropertyValue()
---CREDITS--
-Robin Fernandes <robinf@php.net>
-Steve Seear <stevseea@php.net>
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?>
---FILE--
-<?php
-class A {
- static private $privateOverridden = "original private";
- static protected $protectedOverridden = "original protected";
- static public $publicOverridden = "original public";
-}
-
-class B extends A {
- static private $privateOverridden = "changed private";
- static protected $protectedOverridden = "changed protected";
- static public $publicOverridden = "changed public";
-}
-
-echo "Set static values in A:\n";
-$rcA = new ReflectionClass('A');
-$rcA->setStaticPropertyValue("\0A\0privateOverridden", "new value 1");
-$rcA->setStaticPropertyValue("\0*\0protectedOverridden", "new value 2");
-$rcA->setStaticPropertyValue("publicOverridden", "new value 3");
-print_r($rcA->getStaticProperties());
-
-echo "\nSet static values in B:\n";
-$rcB = new ReflectionClass('B');
-$rcB->setStaticPropertyValue("\0A\0privateOverridden", "new value 4");
-$rcB->setStaticPropertyValue("\0B\0privateOverridden", "new value 5");
-$rcB->setStaticPropertyValue("\0*\0protectedOverridden", "new value 6");
-$rcB->setStaticPropertyValue("publicOverridden", "new value 7");
-print_r($rcA->getStaticProperties());
-print_r($rcB->getStaticProperties());
-
-echo "\nSet non-existent values from A with no default value:\n";
-try {
- var_dump($rcA->setStaticPropertyValue("protectedOverridden", "new value 8"));
- echo "you should not see this";
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
-}
-
-try {
- var_dump($rcA->setStaticPropertyValue("privateOverridden", "new value 9"));
- echo "you should not see this";
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
-}
-
-?>
---EXPECTF--
-Set static values in A:
-
-Fatal error: Uncaught ReflectionException: Class A does not have a property named in %sReflectionClass_setStaticPropertyValue_001_2_4.php:%d
-Stack trace:
-#0 %sReflectionClass_setStaticPropertyValue_001_2_4.php(%d): ReflectionClass->setStaticPropertyValue('\x00A\x00privateOverr...', 'new value 1')
-#1 {main}
- thrown in %sReflectionClass_setStaticPropertyValue_001_2_4.php on line %d
diff --git a/ext/standard/tests/array/array_fill_object.phpt b/ext/standard/tests/array/array_fill_object.phpt
index 86773b17f8..aa1db044cc 100644
--- a/ext/standard/tests/array/array_fill_object.phpt
+++ b/ext/standard/tests/array/array_fill_object.phpt
@@ -1,7 +1,5 @@
--TEST--
Test array_fill() function : usage variations - various object values for 'val' argument
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.4.0', '>=')) die('skip ZendEngine 2.3 or below needed'); ?>
--FILE--
<?php
/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
@@ -290,23 +288,23 @@ array(2) {
object(Child_test2)#%d (4) {
["member1":"Child_test2":private]=>
int(102)
- ["member1":"Test2":private]=>
- int(100)
["var1"]=>
int(30)
["var2"]=>
int(101)
+ ["member1":"Test2":private]=>
+ int(100)
}
[1]=>
object(Child_test2)#%d (4) {
["member1":"Child_test2":private]=>
int(102)
- ["member1":"Test2":private]=>
- int(100)
["var1"]=>
int(30)
["var2"]=>
int(101)
+ ["member1":"Test2":private]=>
+ int(100)
}
}
-- Iteration 6 --
diff --git a/ext/standard/tests/array/array_fill_object_2_4.phpt b/ext/standard/tests/array/array_fill_object_2_4.phpt
deleted file mode 100644
index fb8179766c..0000000000
--- a/ext/standard/tests/array/array_fill_object_2_4.phpt
+++ /dev/null
@@ -1,434 +0,0 @@
---TEST--
-Test array_fill() function : usage variations - various object values for 'val' argument
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?>
---FILE--
-<?php
-/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
- * Description: Create an array containing num elements starting with index start_key each initialized to val
- * Source code: ext/standard/array.c
- */
-
-/*
- * testing array_fill() by passing various object values for 'val' argument
- */
-
-echo "*** Testing array_fill() : usage variations ***\n";
-
-// Initialise function arguments not being substituted
-$start_key = 0;
-$num = 2;
-
-// class without a member
-class Test
-{
-}
-
-//class with public member, static member , constant and consturctor to initialize the public member
-class Test1
-{
- const test1_constant = "test1";
- public static $test1_static = 0;
- public $member1;
- var $var1 = 30;
- var $var2;
-
- function __construct($value1 , $value2)
- {
- $this->member1 = $value1;
- $this->var2 = $value2;
- }
-}
-
-// child class which inherits parent class test1
-class Child_test1 extends Test1
-{
- public $member2;
-
- function __construct($value1 , $value2 , $value3)
- {
- parent::__construct($value1 , $value2);
- $this->member2 = $value3;
- }
-}
-
-//class with private member, static member, constant and constructor to initialize the private member
-class Test2
-{
- const test2_constant = "test2";
- public static $test2_static = 0;
- private $member1;
- var $var1 = 30;
- var $var2;
-
- function __construct($value1 , $value2)
- {
- $this->member1 = $value1;
- $this->var2 = $value2;
- }
-}
-
-// child class which inherits parent class test2
-class Child_test2 extends Test2
-{
- private $member1;
-
- function __construct($value1 , $value2 , $value3)
- {
- parent::__construct($value1 , $value2);
- $this->member1 = $value3;
- }
-}
-
-// class with protected member, static member, constant and consturctor to initialize the protected member
-class Test3
-{
- const test3_constant = "test3";
- public static $test3_static = 0;
- protected $member1;
- var $var1 = 30;
- var $var2;
-
- function __construct($value1 , $value2)
- {
- $this->member1 = $value1;
- $this->var2 = $value2;
- }
-}
-
-// child class which inherits parent class test3
-class Child_test3 extends Test3
-{
- protected $member1;
-
- function __construct($value1 , $value2 , $value3)
- {
- parent::__construct($value1 , $value2);
- $this->member1 = $value3;
- }
-}
-
-// class with public, private, protected members, static, constant members and constructor to initialize all the members
-class Test4
-{
- const test4_constant = "test4";
- public static $test4_static = 0;
- public $member1;
- private $member2;
- protected $member3;
-
- function __construct($value1 , $value2 , $value3)
- {
- $this->member1 = $value1;
- $this->member2 = $value2;
- $this->member3 = $value3;
- }
-}
-
-// child class which inherits parent class test4
-class Child_test4 extends Test4
-{
- var $var1;
-
- function __construct($value1 , $value2 , $value3 , $value4)
- {
- parent::__construct($value1 , $value2 , $value3);
- $this->var1 = $value4;
- }
-}
-
-// abstract class with public, private, protected members
-abstract class AbstractClass
-{
- public $member1;
- private $member2;
- protected $member3;
- var $var1 = 30;
-
- abstract protected function display();
-}
-
-// implement abstract 'AbstractClass' class
-class ConcreteClass1 extends AbstractClass
-{
- protected function display()
- {
- echo "class name is ConcreteClass1 \n";
- }
-}
-
-
-// declarationn of the interface 'iTemplate'
-interface iTemplate
-{
- public function display();
-}
-
-// implement the interface 'iTemplate'
-class Template1 implements iTemplate
-{
- public function display()
- {
- echo "class name is Template1\n";
- }
-}
-
-//array of object values for 'val' argument
-$objects = array(
-
- /* 1 */ new Test(),
- new Test1(100 , 101),
- new Child_test1(100 , 101 , 102),
- new Test2(100 , 101),
- /* 5 */ new Child_test2(100 , 101 , 102),
- new Test3(100 , 101),
- new Child_test3(100 , 101 , 102),
- new Test4( 100 , 101 , 102),
- new Child_test4(100 , 101 , 102 , 103),
- new ConcreteClass1(),
- /* 11 */ new Template1()
-);
-
-// loop through each element of the array for 'val' argument
-// check the working of array_fill()
-echo "--- Testing array_fill() with different object values for 'val' argument ---\n";
-$counter = 1;
-for($index = 0; $index < count($objects); $index ++)
-{
- echo "-- Iteration $counter --\n";
- $val = $objects[$index];
-
- var_dump( array_fill($start_key,$num,$val) );
-
- $counter++;
-}
-
-echo "Done";
-?>
---EXPECTF--
-*** Testing array_fill() : usage variations ***
---- Testing array_fill() with different object values for 'val' argument ---
--- Iteration 1 --
-array(2) {
- [0]=>
- object(Test)#%d (0) {
- }
- [1]=>
- object(Test)#%d (0) {
- }
-}
--- Iteration 2 --
-array(2) {
- [0]=>
- object(Test1)#%d (3) {
- ["member1"]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
- [1]=>
- object(Test1)#%d (3) {
- ["member1"]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
-}
--- Iteration 3 --
-array(2) {
- [0]=>
- object(Child_test1)#%d (4) {
- ["member2"]=>
- int(102)
- ["member1"]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
- [1]=>
- object(Child_test1)#%d (4) {
- ["member2"]=>
- int(102)
- ["member1"]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
-}
--- Iteration 4 --
-array(2) {
- [0]=>
- object(Test2)#%d (3) {
- ["member1":"Test2":private]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
- [1]=>
- object(Test2)#%d (3) {
- ["member1":"Test2":private]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
-}
--- Iteration 5 --
-array(2) {
- [0]=>
- object(Child_test2)#%d (4) {
- ["member1":"Child_test2":private]=>
- int(102)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- ["member1":"Test2":private]=>
- int(100)
- }
- [1]=>
- object(Child_test2)#%d (4) {
- ["member1":"Child_test2":private]=>
- int(102)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- ["member1":"Test2":private]=>
- int(100)
- }
-}
--- Iteration 6 --
-array(2) {
- [0]=>
- object(Test3)#%d (3) {
- ["member1":protected]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
- [1]=>
- object(Test3)#%d (3) {
- ["member1":protected]=>
- int(100)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
-}
--- Iteration 7 --
-array(2) {
- [0]=>
- object(Child_test3)#%d (3) {
- ["member1":protected]=>
- int(102)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
- [1]=>
- object(Child_test3)#%d (3) {
- ["member1":protected]=>
- int(102)
- ["var1"]=>
- int(30)
- ["var2"]=>
- int(101)
- }
-}
--- Iteration 8 --
-array(2) {
- [0]=>
- object(Test4)#%d (3) {
- ["member1"]=>
- int(100)
- ["member2":"Test4":private]=>
- int(101)
- ["member3":protected]=>
- int(102)
- }
- [1]=>
- object(Test4)#%d (3) {
- ["member1"]=>
- int(100)
- ["member2":"Test4":private]=>
- int(101)
- ["member3":protected]=>
- int(102)
- }
-}
--- Iteration 9 --
-array(2) {
- [0]=>
- object(Child_test4)#%d (4) {
- ["var1"]=>
- int(103)
- ["member1"]=>
- int(100)
- ["member2":"Test4":private]=>
- int(101)
- ["member3":protected]=>
- int(102)
- }
- [1]=>
- object(Child_test4)#%d (4) {
- ["var1"]=>
- int(103)
- ["member1"]=>
- int(100)
- ["member2":"Test4":private]=>
- int(101)
- ["member3":protected]=>
- int(102)
- }
-}
--- Iteration 10 --
-array(2) {
- [0]=>
- object(ConcreteClass1)#%d (4) {
- ["member1"]=>
- NULL
- ["member2":"AbstractClass":private]=>
- NULL
- ["member3":protected]=>
- NULL
- ["var1"]=>
- int(30)
- }
- [1]=>
- object(ConcreteClass1)#%d (4) {
- ["member1"]=>
- NULL
- ["member2":"AbstractClass":private]=>
- NULL
- ["member3":protected]=>
- NULL
- ["var1"]=>
- int(30)
- }
-}
--- Iteration 11 --
-array(2) {
- [0]=>
- object(Template1)#%d (0) {
- }
- [1]=>
- object(Template1)#%d (0) {
- }
-}
-Done
diff --git a/ext/standard/tests/class_object/is_a.phpt b/ext/standard/tests/class_object/is_a.phpt
index 832d5550f1..db74cdcc9a 100644
--- a/ext/standard/tests/class_object/is_a.phpt
+++ b/ext/standard/tests/class_object/is_a.phpt
@@ -1,7 +1,5 @@
--TEST--
is_a and is_subclass_of behaviour (with and without autoload)
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
<?php
diff --git a/ext/standard/tests/serialize/bug26762.phpt b/ext/standard/tests/serialize/bug26762.phpt
index 3011bb602c..dd779780f4 100644
--- a/ext/standard/tests/serialize/bug26762.phpt
+++ b/ext/standard/tests/serialize/bug26762.phpt
@@ -2,7 +2,6 @@
Bug #26762 (unserialize() produces lowercase classnames)
--SKIPIF--
<?php
- if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
if (class_exists('autoload_root')) die('skip Autoload test classes exist already');
?>
--FILE--
diff --git a/ext/standard/tests/strings/bug24281.phpt b/ext/standard/tests/strings/bug24281.phpt
index 3c041d67cb..66a30913e8 100644
--- a/ext/standard/tests/strings/bug24281.phpt
+++ b/ext/standard/tests/strings/bug24281.phpt
@@ -1,9 +1,5 @@
--TEST--
Bug #24281 (str_replace count not returned if variable wasn't initialized)
---SKIPIF--
-<?php
- if (version_compare(zend_version(), '2.0.0-dev', '<')) die('SKIP PHP5 functionality');
-?>
--FILE--
<?php
$string = "He had had to have had it";