@@ -30,6 +30,10 @@ reload_nginx() {
30
30
$superuser /etc/init.d/nginx restart
31
31
}
32
32
33
+ php_v5_3_shim () {
34
+ remove_double_colon_class_name_resolution
35
+ }
36
+
33
37
phpunit_shim () {
34
38
# -class CurlTest extends \PHPUnit\Framework\TestCase
35
39
# +class CurlTest extends \PHPUnit_Framework_TestCase
@@ -51,6 +55,36 @@ phpunit_shim() {
51
55
sed -i' ' -e" s/${find} /${replace} /" " $( pwd) /tests/PHPCurlClass/PHP" *
52
56
}
53
57
58
+ remove_double_colon_class_name_resolution () {
59
+ sed -i' ' -e" /::class/d" " $( pwd) /tests/PHPCurlClass/PHP" *
60
+ }
61
+
62
+ remove_expectWarning () {
63
+ # Fix "Call to undefined method CurlTest\CurlTest::expectWarning()".
64
+ sed -i' ' -e" /->expectWarning(/d" " $( pwd) /tests/PHPCurlClass/PHP" *
65
+ }
66
+
67
+ replace_assertStringContainsString () {
68
+ # -->assertStringContainsString(
69
+ # +->assertContains(
70
+ find=' ->assertStringContainsString('
71
+ replace=' ->assertContains('
72
+ sed -i' ' -e" s/${find} /${replace} /" " $( pwd) /tests/PHPCurlClass/PHP" *
73
+ }
74
+
75
+ phpunit_v4_8_shim () {
76
+ replace_assertStringContainsString
77
+ }
78
+
79
+ phpunit_v6_5_shim () {
80
+ remove_expectWarning
81
+ replace_assertStringContainsString
82
+ }
83
+
84
+ phpunit_v7_5_shim () {
85
+ remove_expectWarning
86
+ }
87
+
54
88
set -x
55
89
echo " TRAVIS_PHP_VERSION: ${TRAVIS_PHP_VERSION} "
56
90
php -r " var_dump(phpversion());"
107
141
$superuser /etc/init.d/php5-fpm start
108
142
reload_nginx
109
143
phpunit_shim
144
+ phpunit_v4_8_shim
145
+ php_v5_3_shim
110
146
elif [[ " ${TRAVIS_PHP_VERSION} " == " 5.4" ]]; then
111
147
install_nginx
112
148
use_php_fpm
@@ -123,8 +159,10 @@ elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then
123
159
reload_nginx
124
160
phpunit_shim
125
161
elif [[ " ${TRAVIS_PHP_VERSION} " == " 7.0" ]]; then
162
+ phpunit_v6_5_shim
126
163
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
127
164
elif [[ " ${TRAVIS_PHP_VERSION} " == " 7.1" ]]; then
165
+ phpunit_v7_5_shim
128
166
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
129
167
elif [[ " ${TRAVIS_PHP_VERSION} " == " 7.2" ]]; then
130
168
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
0 commit comments