diff options
author | Nikita Popov <nikic@php.net> | 2016-11-20 21:24:51 +0100 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-11-20 22:31:24 +0100 |
commit | 45f7b2bcc8f95e793c1a9bb60da0848860c060fb (patch) | |
tree | 2a5b25e11e63b1d5f8dad9d1cbd8601364709996 /Zend | |
parent | 563a341df7c7a74de706d62ab5e4a8a0c2e9152f (diff) | |
download | php-git-45f7b2bcc8f95e793c1a9bb60da0848860c060fb.tar.gz |
Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/tests/bug55509.phpt | 142 | ||||
-rw-r--r-- | Zend/tests/bug64979.phpt | 60 | ||||
-rw-r--r-- | Zend/tests/bug71474.phpt | 46 | ||||
-rw-r--r-- | Zend/tests/bug72918.phpt | 44 | ||||
-rw-r--r-- | Zend/tests/str_offset_002.phpt | 24 | ||||
-rw-r--r-- | Zend/tests/traits/bugs/case-sensitive.phpt | 46 | ||||
-rw-r--r-- | Zend/tests/traits/static_001.phpt | 42 | ||||
-rw-r--r-- | Zend/tests/traits/static_002.phpt | 44 | ||||
-rw-r--r-- | Zend/tests/traits/static_003.phpt | 52 | ||||
-rw-r--r-- | Zend/tests/traits/static_004.phpt | 42 | ||||
-rw-r--r-- | Zend/tests/traits/static_forward_static_call.phpt | 54 | ||||
-rw-r--r-- | Zend/tests/traits/static_get_called_class.phpt | 46 | ||||
-rw-r--r-- | Zend/tests/traits/trait_constant_001.phpt | 72 | ||||
-rw-r--r-- | Zend/tests/traits/trait_constant_002.phpt | 52 |
14 files changed, 383 insertions, 383 deletions
diff --git a/Zend/tests/bug55509.phpt b/Zend/tests/bug55509.phpt index 5268789df6..4fc3299620 100644 --- a/Zend/tests/bug55509.phpt +++ b/Zend/tests/bug55509.phpt @@ -1,71 +1,71 @@ ---TEST--
-Bug #55509 (segfault on x86_64 using more than 2G memory)
---SKIPIF--
-<?php
-if (PHP_INT_SIZE == 4) {
- die('skip Not for 32-bits OS');
-}
-
-$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
-if ($zend_mm_enabled === "0") {
- die("skip Zend MM disabled");
-}
-
-if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
-// check the available memory
-if (PHP_OS == 'Linux') {
- $lines = file('/proc/meminfo');
- $infos = array();
- foreach ($lines as $line) {
- $tmp = explode(":", $line);
- $index = strtolower($tmp[0]);
- $value = (int)ltrim($tmp[1], " ")*1024;
- $infos[$index] = $value;
- }
- $freeMemory = $infos['memfree']+$infos['buffers']+$infos['cached'];
- if ($freeMemory < 2100*1024*1024) {
- die('skip Not enough memory.');
- }
-}
-elseif (PHP_OS == 'FreeBSD') {
- $lines = explode("\n",`sysctl -a`);
- $infos = array();
- foreach ($lines as $line) {
- if(!$line){
- continue;
- }
- $tmp = explode(":", $line);
- $index = strtolower($tmp[0]);
- $value = trim($tmp[1], " ");
- $infos[$index] = $value;
- }
- $freeMemory = ($infos['vm.stats.vm.v_inactive_count']*$infos['hw.pagesize'])
- +($infos['vm.stats.vm.v_cache_count']*$infos['hw.pagesize'])
- +($infos['vm.stats.vm.v_free_count']*$infos['hw.pagesize']);
- if ($freeMemory < 2100*1024*1024) {
- die('skip Not enough memory.');
- }
-}
-?>
---INI--
-memory_limit=2100M
---FILE--
-<?php
-$a1 = str_repeat("1", 1024 * 1024 * 1024 * 0.5);
-echo "1\n";
-$a2 = str_repeat("2", 1024 * 1024 * 1024 * 0.5);
-echo "2\n";
-$a3 = str_repeat("3", 1024 * 1024 * 1024 * 0.5);
-echo "3\n";
-$a4 = str_repeat("4", 1024 * 1024 * 1024 * 0.5);
-echo "4\n";
-$a5 = str_repeat("5", 1024 * 1024 * 1024 * 0.5);
-echo "5\n";
-?>
---EXPECTF--
-1
-2
-3
-4
-
-Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d
+--TEST-- +Bug #55509 (segfault on x86_64 using more than 2G memory) +--SKIPIF-- +<?php +if (PHP_INT_SIZE == 4) { + die('skip Not for 32-bits OS'); +} + +$zend_mm_enabled = getenv("USE_ZEND_ALLOC"); +if ($zend_mm_enabled === "0") { + die("skip Zend MM disabled"); +} + +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +// check the available memory +if (PHP_OS == 'Linux') { + $lines = file('/proc/meminfo'); + $infos = array(); + foreach ($lines as $line) { + $tmp = explode(":", $line); + $index = strtolower($tmp[0]); + $value = (int)ltrim($tmp[1], " ")*1024; + $infos[$index] = $value; + } + $freeMemory = $infos['memfree']+$infos['buffers']+$infos['cached']; + if ($freeMemory < 2100*1024*1024) { + die('skip Not enough memory.'); + } +} +elseif (PHP_OS == 'FreeBSD') { + $lines = explode("\n",`sysctl -a`); + $infos = array(); + foreach ($lines as $line) { + if(!$line){ + continue; + } + $tmp = explode(":", $line); + $index = strtolower($tmp[0]); + $value = trim($tmp[1], " "); + $infos[$index] = $value; + } + $freeMemory = ($infos['vm.stats.vm.v_inactive_count']*$infos['hw.pagesize']) + +($infos['vm.stats.vm.v_cache_count']*$infos['hw.pagesize']) + +($infos['vm.stats.vm.v_free_count']*$infos['hw.pagesize']); + if ($freeMemory < 2100*1024*1024) { + die('skip Not enough memory.'); + } +} +?> +--INI-- +memory_limit=2100M +--FILE-- +<?php +$a1 = str_repeat("1", 1024 * 1024 * 1024 * 0.5); +echo "1\n"; +$a2 = str_repeat("2", 1024 * 1024 * 1024 * 0.5); +echo "2\n"; +$a3 = str_repeat("3", 1024 * 1024 * 1024 * 0.5); +echo "3\n"; +$a4 = str_repeat("4", 1024 * 1024 * 1024 * 0.5); +echo "4\n"; +$a5 = str_repeat("5", 1024 * 1024 * 1024 * 0.5); +echo "5\n"; +?> +--EXPECTF-- +1 +2 +3 +4 + +Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d diff --git a/Zend/tests/bug64979.phpt b/Zend/tests/bug64979.phpt index 5bc8e5a6ab..6122ccf270 100644 --- a/Zend/tests/bug64979.phpt +++ b/Zend/tests/bug64979.phpt @@ -1,30 +1,30 @@ ---TEST--
-Bug #64979 (Wrong behavior of static variables in closure generators)
---FILE--
-<?php
-
-function new_closure_gen() {
- return function() {
- static $foo = 0;
- yield ++$foo;
- };
-}
-
-$closure1 = new_closure_gen();
-$closure2 = new_closure_gen();
-
-$gen1 = $closure1();
-$gen2 = $closure1();
-$gen3 = $closure2();
-
-foreach (array($gen1, $gen2, $gen3) as $gen) {
- foreach ($gen as $val) {
- var_dump($val);
- }
-}
-
-?>
---EXPECT--
-int(1)
-int(2)
-int(1)
+--TEST-- +Bug #64979 (Wrong behavior of static variables in closure generators) +--FILE-- +<?php + +function new_closure_gen() { + return function() { + static $foo = 0; + yield ++$foo; + }; +} + +$closure1 = new_closure_gen(); +$closure2 = new_closure_gen(); + +$gen1 = $closure1(); +$gen2 = $closure1(); +$gen3 = $closure2(); + +foreach (array($gen1, $gen2, $gen3) as $gen) { + foreach ($gen as $val) { + var_dump($val); + } +} + +?> +--EXPECT-- +int(1) +int(2) +int(1) diff --git a/Zend/tests/bug71474.phpt b/Zend/tests/bug71474.phpt index e67bb9b240..72b0db91a1 100644 --- a/Zend/tests/bug71474.phpt +++ b/Zend/tests/bug71474.phpt @@ -1,23 +1,23 @@ ---TEST--
-Bug #71474: Crash because of VM stack corruption on Magento2
---FILE--
-<?php
-class foo {
- function __call($name, $args) {
- $a = $b = $c = $d = $e = $f = 1;
- }
-}
-
-function test($n, $x) {
-// var_dump($n);
- if ($n > 0) {
- $x->bug();
- test($n - 1, $x);
- }
-}
-
-test(3000, new foo());
-echo "OK\n";
-?>
---EXPECT--
-OK
+--TEST-- +Bug #71474: Crash because of VM stack corruption on Magento2 +--FILE-- +<?php +class foo { + function __call($name, $args) { + $a = $b = $c = $d = $e = $f = 1; + } +} + +function test($n, $x) { +// var_dump($n); + if ($n > 0) { + $x->bug(); + test($n - 1, $x); + } +} + +test(3000, new foo()); +echo "OK\n"; +?> +--EXPECT-- +OK diff --git a/Zend/tests/bug72918.phpt b/Zend/tests/bug72918.phpt index f3dc1d2918..403d4e69c5 100644 --- a/Zend/tests/bug72918.phpt +++ b/Zend/tests/bug72918.phpt @@ -1,22 +1,22 @@ ---TEST--
-Bug #72918 (negative offset inside a quoted string leads to parse error)
---FILE--
-<?php
-$array = [-3 => 'foo'];
-$string = 'abcde';
-
-echo "$array[-3]\n";
-echo "$string[-3]\n";
-echo <<<EOT
-$array[-3]
-$string[-3]
-
-EOT;
-?>
-===DONE===
---EXPECT--
-foo
-c
-foo
-c
-===DONE===
+--TEST-- +Bug #72918 (negative offset inside a quoted string leads to parse error) +--FILE-- +<?php +$array = [-3 => 'foo']; +$string = 'abcde'; + +echo "$array[-3]\n"; +echo "$string[-3]\n"; +echo <<<EOT +$array[-3] +$string[-3] + +EOT; +?> +===DONE=== +--EXPECT-- +foo +c +foo +c +===DONE=== diff --git a/Zend/tests/str_offset_002.phpt b/Zend/tests/str_offset_002.phpt index 2f5e4ee890..d3a9152905 100644 --- a/Zend/tests/str_offset_002.phpt +++ b/Zend/tests/str_offset_002.phpt @@ -1,12 +1,12 @@ ---TEST--
-string offset 002
---FILE--
-<?php
-$a = "aaa";
-$x = array(&$a[1]);
-?>
---EXPECTF--
-Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sstr_offset_002.php:3
-Stack trace:
-#0 {main}
- thrown in %sstr_offset_002.php on line 3
+--TEST-- +string offset 002 +--FILE-- +<?php +$a = "aaa"; +$x = array(&$a[1]); +?> +--EXPECTF-- +Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sstr_offset_002.php:3 +Stack trace: +#0 {main} + thrown in %sstr_offset_002.php on line 3 diff --git a/Zend/tests/traits/bugs/case-sensitive.phpt b/Zend/tests/traits/bugs/case-sensitive.phpt index 13d4188f2f..6a65ccff03 100644 --- a/Zend/tests/traits/bugs/case-sensitive.phpt +++ b/Zend/tests/traits/bugs/case-sensitive.phpt @@ -1,23 +1,23 @@ ---TEST--
-Check for problems with case sensitivity in compositions
---FILE--
-<?php
-error_reporting(E_ALL);
-
-trait A {
- public function M1() {}
- public function M2() {}
-}
-
-trait B {
- public function M1() {}
- public function M2() {}
-}
-
-class MyClass {
- use A;
- use B;
-}
-?>
---EXPECTF--
-Fatal error: Trait method M1 has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
+--TEST-- +Check for problems with case sensitivity in compositions +--FILE-- +<?php +error_reporting(E_ALL); + +trait A { + public function M1() {} + public function M2() {} +} + +trait B { + public function M1() {} + public function M2() {} +} + +class MyClass { + use A; + use B; +} +?> +--EXPECTF-- +Fatal error: Trait method M1 has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d diff --git a/Zend/tests/traits/static_001.phpt b/Zend/tests/traits/static_001.phpt index d86cb851b9..5953c008d5 100644 --- a/Zend/tests/traits/static_001.phpt +++ b/Zend/tests/traits/static_001.phpt @@ -1,22 +1,22 @@ ---TEST--
-Traits with static methods.
---CREDITS--
-Simas Toleikis simast@gmail.com
---FILE--
-<?php
-
- trait TestTrait {
- public static function test() {
- return 'Test';
- }
- }
-
- class A {
- use TestTrait;
- }
-
- echo A::test();
-
-?>
---EXPECT--
+--TEST-- +Traits with static methods. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- +<?php + + trait TestTrait { + public static function test() { + return 'Test'; + } + } + + class A { + use TestTrait; + } + + echo A::test(); + +?> +--EXPECT-- Test
\ No newline at end of file diff --git a/Zend/tests/traits/static_002.phpt b/Zend/tests/traits/static_002.phpt index c076085519..64ebf6bf14 100644 --- a/Zend/tests/traits/static_002.phpt +++ b/Zend/tests/traits/static_002.phpt @@ -1,23 +1,23 @@ ---TEST--
-Traits with static methods referenced using variable.
---CREDITS--
-Simas Toleikis simast@gmail.com
---FILE--
-<?php
-
- trait TestTrait {
- public static function test() {
- return 'Test';
- }
- }
-
- class A {
- use TestTrait;
- }
-
- $class = "A";
- echo $class::test();
-
-?>
---EXPECT--
+--TEST-- +Traits with static methods referenced using variable. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- +<?php + + trait TestTrait { + public static function test() { + return 'Test'; + } + } + + class A { + use TestTrait; + } + + $class = "A"; + echo $class::test(); + +?> +--EXPECT-- Test
\ No newline at end of file diff --git a/Zend/tests/traits/static_003.phpt b/Zend/tests/traits/static_003.phpt index fbe5421c71..01953cf724 100644 --- a/Zend/tests/traits/static_003.phpt +++ b/Zend/tests/traits/static_003.phpt @@ -1,27 +1,27 @@ ---TEST--
-Traits with late static bindings.
---CREDITS--
-Simas Toleikis simast@gmail.com
---FILE--
-<?php
-
- trait TestTrait {
- public static function test() {
- return static::$test;
- }
- }
-
- class A {
- use TestTrait;
- protected static $test = "Test A";
- }
-
- class B extends A {
- protected static $test = "Test B";
- }
-
- echo B::test();
-
-?>
---EXPECT--
+--TEST-- +Traits with late static bindings. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- +<?php + + trait TestTrait { + public static function test() { + return static::$test; + } + } + + class A { + use TestTrait; + protected static $test = "Test A"; + } + + class B extends A { + protected static $test = "Test B"; + } + + echo B::test(); + +?> +--EXPECT-- Test B
\ No newline at end of file diff --git a/Zend/tests/traits/static_004.phpt b/Zend/tests/traits/static_004.phpt index c360f457f0..3c3f380908 100644 --- a/Zend/tests/traits/static_004.phpt +++ b/Zend/tests/traits/static_004.phpt @@ -1,22 +1,22 @@ ---TEST--
-Traits with __callStatic magic method.
---CREDITS--
-Simas Toleikis simast@gmail.com
---FILE--
-<?php
-
- trait TestTrait {
- public static function __callStatic($name, $arguments) {
- return $name;
- }
- }
-
- class A {
- use TestTrait;
- }
-
- echo A::Test();
-
-?>
---EXPECT--
+--TEST-- +Traits with __callStatic magic method. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- +<?php + + trait TestTrait { + public static function __callStatic($name, $arguments) { + return $name; + } + } + + class A { + use TestTrait; + } + + echo A::Test(); + +?> +--EXPECT-- Test
\ No newline at end of file diff --git a/Zend/tests/traits/static_forward_static_call.phpt b/Zend/tests/traits/static_forward_static_call.phpt index 878cf1fcc1..9cda8aee1d 100644 --- a/Zend/tests/traits/static_forward_static_call.phpt +++ b/Zend/tests/traits/static_forward_static_call.phpt @@ -1,28 +1,28 @@ ---TEST--
-Traits and forward_static_call().
---CREDITS--
-Simas Toleikis simast@gmail.com
---FILE--
-<?php
-
- trait TestTrait {
- public static function test() {
- return 'Forwarded '.forward_static_call(array('A', 'test'));
- }
- }
-
- class A {
- public static function test() {
- return "Test A";
- }
- }
-
- class B extends A {
- use TestTrait;
- }
-
- echo B::test();
-
-?>
---EXPECT--
+--TEST-- +Traits and forward_static_call(). +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- +<?php + + trait TestTrait { + public static function test() { + return 'Forwarded '.forward_static_call(array('A', 'test')); + } + } + + class A { + public static function test() { + return "Test A"; + } + } + + class B extends A { + use TestTrait; + } + + echo B::test(); + +?> +--EXPECT-- Forwarded Test A
\ No newline at end of file diff --git a/Zend/tests/traits/static_get_called_class.phpt b/Zend/tests/traits/static_get_called_class.phpt index dc29ecefa2..bd7a603712 100644 --- a/Zend/tests/traits/static_get_called_class.phpt +++ b/Zend/tests/traits/static_get_called_class.phpt @@ -1,24 +1,24 @@ ---TEST--
-Traits and get_called_class().
---CREDITS--
-Simas Toleikis simast@gmail.com
---FILE--
-<?php
-
- trait TestTrait {
- public static function test() {
- return get_called_class();
- }
- }
-
- class A {
- use TestTrait;
- }
-
- class B extends A { }
-
- echo B::test();
-
-?>
---EXPECT--
+--TEST-- +Traits and get_called_class(). +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- +<?php + + trait TestTrait { + public static function test() { + return get_called_class(); + } + } + + class A { + use TestTrait; + } + + class B extends A { } + + echo B::test(); + +?> +--EXPECT-- B
\ No newline at end of file diff --git a/Zend/tests/traits/trait_constant_001.phpt b/Zend/tests/traits/trait_constant_001.phpt index 0fd8ff921b..590949c2f6 100644 --- a/Zend/tests/traits/trait_constant_001.phpt +++ b/Zend/tests/traits/trait_constant_001.phpt @@ -1,36 +1,36 @@ ---TEST--
-__TRAIT__: Basics, a constant denoiting the trait of definition.
---FILE--
-<?php
-
-trait TestTrait {
- public static function test() {
- return __TRAIT__;
- }
-}
-
-class Direct {
- use TestTrait;
-}
-
-class IndirectInheritance extends Direct {
-
-}
-
-trait TestTraitIndirect {
- use TestTrait;
-}
-
-class Indirect {
- use TestTraitIndirect;
-}
-
-echo Direct::test()."\n";
-echo IndirectInheritance::test()."\n";
-echo Indirect::test()."\n";
-
-?>
---EXPECT--
-TestTrait
-TestTrait
-TestTrait
+--TEST-- +__TRAIT__: Basics, a constant denoiting the trait of definition. +--FILE-- +<?php + +trait TestTrait { + public static function test() { + return __TRAIT__; + } +} + +class Direct { + use TestTrait; +} + +class IndirectInheritance extends Direct { + +} + +trait TestTraitIndirect { + use TestTrait; +} + +class Indirect { + use TestTraitIndirect; +} + +echo Direct::test()."\n"; +echo IndirectInheritance::test()."\n"; +echo Indirect::test()."\n"; + +?> +--EXPECT-- +TestTrait +TestTrait +TestTrait diff --git a/Zend/tests/traits/trait_constant_002.phpt b/Zend/tests/traits/trait_constant_002.phpt index 327dd44a64..bbafbf210e 100644 --- a/Zend/tests/traits/trait_constant_002.phpt +++ b/Zend/tests/traits/trait_constant_002.phpt @@ -1,27 +1,27 @@ ---TEST--
-__TRAIT__: Use outside of traits.
---FILE--
-<?php
-
- class MyClass {
- static function test() {
- return __TRAIT__;
- }
- }
-
- function someFun() {
- return __TRAIT__;
- }
-
-
- $t = __TRAIT__;
- var_dump($t);
- $t = MyClass::test();
- var_dump($t);
- $t = someFun();
- var_dump($t);
-?>
---EXPECT--
-string(0) ""
-string(0) ""
+--TEST-- +__TRAIT__: Use outside of traits. +--FILE-- +<?php + + class MyClass { + static function test() { + return __TRAIT__; + } + } + + function someFun() { + return __TRAIT__; + } + + + $t = __TRAIT__; + var_dump($t); + $t = MyClass::test(); + var_dump($t); + $t = someFun(); + var_dump($t); +?> +--EXPECT-- +string(0) "" +string(0) "" string(0) ""
\ No newline at end of file |