1
- SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
2
- cd " ${SCRIPT_DIR} "
3
-
4
- # Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable.
5
- export PATH=" ${PWD} /vendor/bin:${PATH} "
6
-
7
- remove_expectWarning () {
8
- # Fix "Call to undefined method CurlTest\CurlTest::expectWarning()".
9
- sed -i' ' -e" /->expectWarning(/d" " $( pwd) /tests/PHPCurlClass/PHP" *
10
- }
11
-
12
- replace_assertStringContainsString () {
13
- # -->assertStringContainsString(
14
- # +->assertContains(
15
- find=' ->assertStringContainsString('
16
- replace=' ->assertContains('
17
- sed -i' ' -e" s/${find} /${replace} /" " $( pwd) /tests/PHPCurlClass/PHP" *
18
- }
19
-
20
- phpunit_v6_5_shim () {
21
- remove_expectWarning
22
- replace_assertStringContainsString
23
- }
24
-
25
- phpunit_v7_5_shim () {
26
- remove_expectWarning
27
- }
28
-
29
- phpunit_v8_1_shim () {
30
- remove_expectWarning
31
- }
32
-
33
1
start_php_servers () {
34
2
for i in $( seq 0 6) ; do
35
3
port=8000
@@ -49,24 +17,6 @@ composer install --prefer-source --no-interaction
49
17
# Let test server know we should allow testing.
50
18
export PHP_CURL_CLASS_TEST_MODE_ENABLED=" yes"
51
19
52
- # Determine which phpunit to use.
53
- if [[ -f " ../vendor/bin/phpunit" ]]; then
54
- phpunit_to_use=" ../vendor/bin/phpunit"
55
- else
56
- phpunit_to_use=" phpunit"
57
- fi
58
-
59
- phpunit_version=" $( " ${phpunit_to_use} " --version | grep -Eo " [0-9]+\.[0-9]+\.[0-9]+" ) "
60
- echo " ${phpunit_version} "
61
-
62
- if [[ " ${phpunit_version} " == " 6.5." * ]]; then
63
- phpunit_v6_5_shim
64
- elif [[ " ${phpunit_version} " == " 7.5." * ]]; then
65
- phpunit_v7_5_shim
66
- elif [[ " ${phpunit_version} " == " 8.1." * ]]; then
67
- phpunit_v8_1_shim
68
- fi
69
-
70
20
if [[ " ${CI_PHP_VERSION} " == " 7.0" ]]; then
71
21
start_php_servers
72
22
elif [[ " ${CI_PHP_VERSION} " == " 7.1" ]]; then
0 commit comments