diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 00000000..03e7bb48 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,93 @@ +name: Workflow +on: [push] +jobs: + php_8_job: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['8.0'] + include: + - os: ubuntu-18.04 + SYMFONY_VERSION: 6.0.* + steps: + - uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: intl #optional + ini-values: "post_max_size=256M" #optional + - name: Check PHP Version + run: php -v + - run: sudo composer self-update + - run: >- + composer require symfony/framework-bundle:${SYMFONY_VERSION} + --no-update + env: + SYMFONY_VERSION: '${{ matrix.SYMFONY_VERSION }}' + - run: composer install --prefer-dist --no-interaction + - run: ./src/BeSimple/SoapClient/Tests/bin/phpwebserver.sh + - run: ./src/BeSimple/SoapClient/Tests/bin/axis.sh + - run: bin/simple-phpunit --debug + + php_7-syf_5_job: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.2','7.3','7.4'] + include: + - os: ubuntu-18.04 + SYMFONY_VERSION: 5.4.* + steps: + - uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: intl #optional + ini-values: "post_max_size=256M" #optional + - name: Check PHP Version + run: php -v + - run: sudo composer self-update + - run: >- + composer require symfony/framework-bundle:${SYMFONY_VERSION} + --no-update + env: + SYMFONY_VERSION: '${{ matrix.SYMFONY_VERSION }}' + - run: composer install --prefer-dist --no-interaction + - run: ./src/BeSimple/SoapClient/Tests/bin/phpwebserver.sh + - run: ./src/BeSimple/SoapClient/Tests/bin/axis.sh + - run: bin/simple-phpunit + + + php_7-syf_3_job: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.2','7.3','7.4'] + include: + - os: ubuntu-18.04 + SYMFONY_VERSION: 3.4.* + steps: + - uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: intl #optional + ini-values: "post_max_size=256M" #optional + - name: Check PHP Version + run: php -v + - run: sudo composer self-update + - run: >- + composer require symfony/framework-bundle:${SYMFONY_VERSION} + --no-update + env: + SYMFONY_VERSION: '${{ matrix.SYMFONY_VERSION }}' + - run: composer install --prefer-dist --no-interaction + - run: ./src/BeSimple/SoapClient/Tests/bin/phpwebserver.sh + - run: ./src/BeSimple/SoapClient/Tests/bin/axis.sh + - run: bin/simple-phpunit \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 975c165f..df08e6de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM composer:1 AS composer +FROM composer:2 AS composer -FROM php:7.0-fpm +FROM php:8.0.0-fpm COPY --from=composer /usr/bin/composer /usr/bin/composer @@ -8,4 +8,19 @@ COPY --from=composer /usr/bin/composer /usr/bin/composer RUN apt-get update -y \ && apt-get install -y libxml2-dev git unzip \ && apt-get clean -y \ - && docker-php-ext-install soap \ No newline at end of file + && docker-php-ext-install soap + +#RUN apt-get update && \ +# apt-get install -y openjdk-11-jdk && \ +# apt-get install -y ant && \ +# apt-get clean; +# +## Fix certificate issues +#RUN apt-get update && \ +# apt-get install ca-certificates-java && \ +# apt-get clean && \ +# update-ca-certificates -f; +# +## Setup JAVA_HOME -- useful for docker commandline +#ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/ +#RUN export JAVA_HOME \ No newline at end of file diff --git a/Makefile b/Makefile index 8e8a941b..1121d879 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ QA = docker run -it --rm -v `pwd`:/project mykiwi/phaudit:7.2 ## ------- ## + kill: $(DOCKER_COMPOSE) kill $(DOCKER_COMPOSE) down --volumes --remove-orphans @@ -25,6 +26,8 @@ composer-install: ## Execute composer instalation $(COMPOSER) install --prefer-dist test: composer-install ## Execute composer instalation + $(RUN) ./src/BeSimple/SoapClient/Tests/bin/phpwebserver.sh + $(RUN) ./src/BeSimple/SoapClient/Tests/bin/axislocal.sh $(RUN) bin/simple-phpunit composer-update: ## Execute package update diff --git a/composer.json b/composer.json index 4d81ed1a..6150c0e8 100644 --- a/composer.json +++ b/composer.json @@ -20,15 +20,15 @@ } ], "require": { - "php": ">=5.4.0", + "php": ">=7.2 || >=8.0", "ext-soap": "*", "ext-curl": "*", "ass/xmlsecurity": "~1.0", - "symfony/framework-bundle": "~2.6 || ~3.4", - "symfony/twig-bundle": "~2.6 || ~3.4", - "zendframework/zend-mime": "2.*", - "zendframework/zend-serializer": "^2.9", - "zendframework/zend-servicemanager": "^3.3" + "symfony/framework-bundle": "^3.4 || ^5.4 || ^6.0", + "symfony/twig-bundle": "^3.4 || ^5.4 || ^6.0", + "laminas/laminas-servicemanager": "^3.4", + "jms/serializer": "^1.10 || ^2.0 || ^3.0", + "laminas/laminas-mime": "^2.7" }, "replace": { "besimple/soap-bundle": "self.version", @@ -39,8 +39,8 @@ }, "require-dev": { "mikey179/vfsstream": "~1.0", - "symfony/filesystem": "~2.3", - "symfony/process": "~2.3", + "symfony/filesystem": "^3.4 || ~5.4 || ~6.0", + "symfony/process": "^3.4 || ~5.4 || ~6.0", "symfony/phpunit-bridge": "*" }, "autoload": { diff --git a/docker-compose.yml b/docker-compose.yml index 27f7f11b..9c00ea14 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: image: smartbox/besimplesoap container_name: sbx_besimplesoap environment: - SYMFONY_PHPUNIT_VERSION: '6.5' + SYMFONY_PHPUNIT_VERSION: '9.5' COMPOSER_ALLOW_SUPERUSER: 1 working_dir: /var/www/html volumes: diff --git a/src/BeSimple/SoapClient/SoapClient.php b/src/BeSimple/SoapClient/SoapClient.php index 5dcf8299..8e306aee 100644 --- a/src/BeSimple/SoapClient/SoapClient.php +++ b/src/BeSimple/SoapClient/SoapClient.php @@ -238,7 +238,7 @@ protected function __doHttpRequest(SoapRequest $soapRequest) * * @return string */ - public function __doRequest($request, $location, $action, $version, $oneWay = 0) + public function __doRequest($request, $location, $action, $version, $oneWay = 0): ?string { // wrap request data in SoapRequest object $soapRequest = SoapRequest::create($request, $location, $action, $version); @@ -307,7 +307,7 @@ protected function filterRequestOptions(SoapRequest $soapRequest) * * @return string */ - public function __getLastRequestHeaders() + public function __getLastRequestHeaders(): ?string { return $this->lastRequestHeaders; } @@ -327,7 +327,7 @@ public function __getRequestHeaders() * * @return string */ - public function __getLastRequest() + public function __getLastRequest(): ?string { return $this->lastRequest; } @@ -347,7 +347,7 @@ public function __getLastRequestUri() * * @return string */ - public function __getLastResponseHeaders() + public function __getLastResponseHeaders(): ?string { return $this->lastResponseHeaders; } @@ -357,7 +357,7 @@ public function __getLastResponseHeaders() * * @return string */ - public function __getLastResponse() + public function __getLastResponse(): ?string { return $this->lastResponse; } diff --git a/src/BeSimple/SoapClient/Tests/AbstractWebserverTest.php b/src/BeSimple/SoapClient/Tests/AbstractWebServerTest.php similarity index 80% rename from src/BeSimple/SoapClient/Tests/AbstractWebserverTest.php rename to src/BeSimple/SoapClient/Tests/AbstractWebServerTest.php index 30c94bfb..a03f4636 100644 --- a/src/BeSimple/SoapClient/Tests/AbstractWebserverTest.php +++ b/src/BeSimple/SoapClient/Tests/AbstractWebServerTest.php @@ -20,9 +20,6 @@ */ abstract class AbstractWebServerTest extends \PHPUnit\Framework\TestCase { - // when using the SetUpTearDownTrait, methods like doSetup() can - // be defined with and without the 'void' return type, as you wish - use \Symfony\Bridge\PhpUnit\SetUpTearDownTrait; /** * @var ProcessBuilder @@ -32,10 +29,6 @@ abstract class AbstractWebServerTest extends \PHPUnit\Framework\TestCase public static function doSetUpBeforeClass() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - self::markTestSkipped('PHP Webserver is available from PHP 5.4'); - } - $phpFinder = new PhpExecutableFinder(); self::$webserver = ProcessBuilder::create(array( 'exec', // used exec binary (https://github.com/symfony/symfony/issues/5759) diff --git a/src/BeSimple/SoapClient/Tests/AxisInterop/TestCase.php b/src/BeSimple/SoapClient/Tests/AxisInterop/TestCase.php index 46d90e89..33d09bd9 100644 --- a/src/BeSimple/SoapClient/Tests/AxisInterop/TestCase.php +++ b/src/BeSimple/SoapClient/Tests/AxisInterop/TestCase.php @@ -4,11 +4,8 @@ class TestCase extends \PHPUnit\Framework\TestCase { - // when using the SetUpTearDownTrait, methods like doSetup() can - // be defined with and without the 'void' return type, as you wish - use \Symfony\Bridge\PhpUnit\SetUpTearDownTrait; - protected function doSetUp() + protected function setUp(): void { $ch = curl_init('http://localhost:8080/'); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); diff --git a/src/BeSimple/SoapClient/Tests/CurlTest.php b/src/BeSimple/SoapClient/Tests/CurlTest.php index 0abf50e3..96a9f24b 100644 --- a/src/BeSimple/SoapClient/Tests/CurlTest.php +++ b/src/BeSimple/SoapClient/Tests/CurlTest.php @@ -17,7 +17,7 @@ /** * @author Andreas Schamberger */ -class CurlTest extends AbstractWebserverTest +class CurlTest extends AbstractWebServerTest { public function testExec() { @@ -37,13 +37,13 @@ public function testGetErrorMessage() )); $curl->exec('http://unknown/curl.txt'); - $this->assertRegExp('/^Could not connect to host.*$/', $curl->getErrorMessage()); + $this->assertMatchesRegularExpression('/^Could not connect to host.*$/', $curl->getErrorMessage()); $curl->exec(sprintf('xyz://localhost:%d/@404.txt', WEBSERVER_PORT)); - $this->assertRegExp('/^Unknown protocol. Only http and https are allowed.*$/', $curl->getErrorMessage()); + $this->assertMatchesRegularExpression('/^Unknown protocol. Only http and https are allowed.*$/', $curl->getErrorMessage()); $curl->exec(''); - $this->assertRegExp('/^Unable to parse URL.*$/', $curl->getErrorMessage()); + $this->assertMatchesRegularExpression('/^Unable to parse URL.*$/', $curl->getErrorMessage()); } public function testGetRequestHeaders() @@ -65,7 +65,8 @@ public function testGetResponse() 'proxy_host' => false, )); - $curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)); + $responseSuccess = $curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)); + $this->assertTrue($responseSuccess); $this->assertSame('OK', $curl->getResponseStatusMessage()); // Adjust for PHP >= 7.2 sending a Date header $response = $curl->getResponse(); diff --git a/src/BeSimple/SoapClient/Tests/ServerInterop/TestCase.php b/src/BeSimple/SoapClient/Tests/ServerInterop/TestCase.php index caf999a4..bb4dcc86 100644 --- a/src/BeSimple/SoapClient/Tests/ServerInterop/TestCase.php +++ b/src/BeSimple/SoapClient/Tests/ServerInterop/TestCase.php @@ -4,18 +4,9 @@ class TestCase extends \PHPUnit\Framework\TestCase { - // when using the SetUpTearDownTrait, methods like doSetup() can - // be defined with and without the 'void' return type, as you wish - use \Symfony\Bridge\PhpUnit\SetUpTearDownTrait; - protected function doSetUp() + protected function setUp(): void { - if (version_compare(PHP_VERSION, '5.3.0', '=')) { - $this->markTestSkipped( - 'The PHP cli webserver is not available with PHP 5.3.' - ); - } - $ch = curl_init('http://localhost:8081/'); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_HEADER, true); diff --git a/src/BeSimple/SoapClient/Tests/SoapClientTest.php b/src/BeSimple/SoapClient/Tests/SoapClientTest.php index d379b9ce..bceb95bd 100644 --- a/src/BeSimple/SoapClient/Tests/SoapClientTest.php +++ b/src/BeSimple/SoapClient/Tests/SoapClientTest.php @@ -50,7 +50,7 @@ public function testSoapFaultWhenPassingInvalidWSDLs($wsdl) } $this->assertInstanceOf('SoapFault', $soapFault, 'Invalid type of exception'); - $this->assertRegExp('/SOAP-ERROR: Parsing WSDL: .*/', $soapFault->getMessage(), 'Invalid or incorrect exception message'); + $this->assertMatchesRegularExpression('/SOAP-ERROR: Parsing WSDL: .*/', $soapFault->getMessage(), 'Invalid or incorrect exception message'); $this->assertStringContainsString('WSDL', $soapFault->faultcode, 'Invalid type of faultcode'); } diff --git a/src/BeSimple/SoapClient/Tests/WsdlDownloaderTest.php b/src/BeSimple/SoapClient/Tests/WsdlDownloaderTest.php index e53acea4..478286a7 100644 --- a/src/BeSimple/SoapClient/Tests/WsdlDownloaderTest.php +++ b/src/BeSimple/SoapClient/Tests/WsdlDownloaderTest.php @@ -23,11 +23,8 @@ * @author Andreas Schamberger * @author Francis Besset */ -class WsdlDownloaderTest extends AbstractWebserverTest +class WsdlDownloaderTest extends AbstractWebServerTest { - // when using the SetUpTearDownTrait, methods like doSetup() can - // be defined with and without the 'void' return type, as you wish - use \Symfony\Bridge\PhpUnit\SetUpTearDownTrait; protected static $filesystem; @@ -57,7 +54,7 @@ public function testDownloadDownloadsToVfs($source, $regexp, $nbDownloads) //Test that the Cache filename is valid $regexp = '#'.sprintf($regexp, $cacheDirForRegExp).'#'; - $this->assertRegExp($regexp, $cacheFileName); + $this->assertMatchesRegularExpression($regexp, $cacheFileName); } @@ -137,7 +134,7 @@ public function testResolveWsdlIncludes($source, $cacheFile, $remoteParentUrl, $ $m->invoke($wsdlDownloader, file_get_contents($source), $cacheFile, $remoteParentUrl); $this->assertCount($nbDownloads, $wsdlCacheDir->getChildren()); - $this->assertRegExp('#'.sprintf($regexp, $cacheDirForRegExp).'#', file_get_contents($cacheFile)); + $this->assertMatchesRegularExpression('#'.sprintf($regexp, $cacheDirForRegExp).'#', file_get_contents($cacheFile)); } public function provideResolveWsdlIncludes() @@ -204,7 +201,7 @@ public function testResolveXsdIncludes($source, $cacheFile, $remoteParentUrl, $r $m->invoke($wsdlDownloader, file_get_contents($source), $cacheFile, $remoteParentUrl); $this->assertCount($nbDownloads, $wsdlCacheDir->getChildren()); - $this->assertRegExp('#'.sprintf($regexp, $cacheDirForRegExp).'#', file_get_contents($cacheFile)); + $this->assertMatchesRegularExpression('#'.sprintf($regexp, $cacheDirForRegExp).'#', file_get_contents($cacheFile)); } public function provideResolveXsdIncludes() @@ -330,7 +327,7 @@ public function testValidResponseCode() $result = $wsdlDownloader->download('http://somefake.url/wsdl'); - $this->assertRegExp('/.*wsdl_[a-f0-9]{32}\.cache/', $result); + $this->assertMatchesRegularExpression('/.*wsdl_[a-f0-9]{32}\.cache/', $result); } public static function doSetUpBeforeClass() diff --git a/src/BeSimple/SoapClient/Tests/axis2server.sh b/src/BeSimple/SoapClient/Tests/axis2server.sh new file mode 100755 index 00000000..8bdb25f2 --- /dev/null +++ b/src/BeSimple/SoapClient/Tests/axis2server.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# ---------------------------------------------------------------------------- +# SimpleAxis2Server Script +# +# Environment Variable Prequisites +# +# AXIS2_HOME Home of Axis2 installation. If not set I will try +# to figure it out. +# +# JAVA_HOME Must point at your Java Development Kit installation. +# +# ----------------------------------------------------------------------------- + +# Get the context and from that find the location of setenv.sh +. `dirname $0`/setenv.sh + +JAVA_OPTS="" +while [ $# -ge 1 ]; do + case $1 in + -xdebug) + JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000" + shift + ;; + -security) + JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$AXIS2_HOME/conf/axis2.policy -Daxis2.home=$AXIS2_HOME" + shift + ;; + -h) + echo "Usage: axis2server.sh" + echo "commands:" + echo " -xdebug Start Axis2 Server under JPDA debugger" + echo " -security Enable Java 2 security" + echo " -h help" + shift + exit 0 + ;; + *) + echo "Error: unknown command:$1" + echo "For help: axis2server.sh -h" + shift + exit 1 + esac +done + +java $JAVA_OPTS -classpath "$AXIS2_CLASSPATH" \ + org.apache.axis2.transport.SimpleAxis2Server \ + -repo "$AXIS2_HOME"/repository -conf "$AXIS2_HOME"/conf/axis2.xml $* diff --git a/src/BeSimple/SoapClient/Tests/bin/axis.sh b/src/BeSimple/SoapClient/Tests/bin/axis.sh index d7ad997e..93454bd5 100755 --- a/src/BeSimple/SoapClient/Tests/bin/axis.sh +++ b/src/BeSimple/SoapClient/Tests/bin/axis.sh @@ -17,7 +17,7 @@ if [ ! -f "$DIR/$ZIP_AXIS" ]; then curl -O -s $PATH_AXIS fi -VERSION_RAMPART=1.5 +VERSION_RAMPART=1.8 ZIP_RAMPART=rampart-dist-$VERSION_RAMPART-bin.zip PATH_RAMPART=http://archive.apache.org/dist/axis/axis2/java/rampart/$VERSION_RAMPART/$ZIP_RAMPART diff --git a/src/BeSimple/SoapClient/Tests/bin/axislocal.sh b/src/BeSimple/SoapClient/Tests/bin/axislocal.sh new file mode 100755 index 00000000..3f36647a --- /dev/null +++ b/src/BeSimple/SoapClient/Tests/bin/axislocal.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR + +VERSION_AXIS=1.8.0 +ZIP_AXIS=axis2-$VERSION_AXIS-bin.zip +if [[ "$VERSION_AXIS" == "1.5.1" ]]; then + PATH_AXIS=https://archive.apache.org/dist/ws/axis2/1_5_1/axis2-1.5.1-bin.zip +elif [[ "$VERSION_AXIS" > "1.5.1" ]]; then + PATH_AXIS=http://archive.apache.org/dist/axis/axis2/java/core/$VERSION_AXIS/$ZIP_AXIS +else + PATH_AXIS=http://archive.apache.org/dist/ws/axis2/${VERSION_AXIS//./_}/$ZIP_AXIS +fi + +if [ ! -f "$DIR/$ZIP_AXIS" ]; then + curl -O -s $PATH_AXIS +fi + +VERSION_RAMPART=1.8 +ZIP_RAMPART=rampart-dist-$VERSION_RAMPART-bin.zip +PATH_RAMPART=http://archive.apache.org/dist/axis/axis2/java/rampart/$VERSION_RAMPART/$ZIP_RAMPART + +if [ ! -f "$DIR/$ZIP_RAMPART" ]; then + curl -O -s $PATH_RAMPART +fi + +unzip -o -qq "$DIR/$ZIP_AXIS" + +AXIS_DIR=$DIR/axis2-$VERSION_AXIS + +unzip -o -qq -j "$DIR/$ZIP_RAMPART" '*/lib/*.jar' -d $AXIS_DIR/lib +unzip -o -qq -j "$DIR/$ZIP_RAMPART" '*/modules/*.mar' -d $AXIS_DIR/repository/modules + +cp -r $DIR/../AxisInterop/axis_services/* $AXIS_DIR/repository/services + +rm $AXIS_DIR/bin/axis2server.sh +cp -r $DIR/../axis2server.sh $AXIS_DIR/bin/axis2server.sh +$AXIS_DIR/bin/axis2server.sh& + +echo "Waiting until Axis is ready on port 8080" +while [[ -z `curl -s 'http://localhost:8080/axis2/services/' ` ]] +do + echo -n "." + sleep 2s +done + +echo "Axis is up" diff --git a/src/BeSimple/SoapCommon/FilterHelper.php b/src/BeSimple/SoapCommon/FilterHelper.php index 01a17177..2c7aeabf 100644 --- a/src/BeSimple/SoapCommon/FilterHelper.php +++ b/src/BeSimple/SoapCommon/FilterHelper.php @@ -134,7 +134,7 @@ public function addNamespace($prefix, $namespaceURI) * * @return \DOMElement */ - public function createElement($namespaceURI, $name, $value = null) + public function createElement($namespaceURI, $name, $value = '') { $prefix = $this->namespaces[$namespaceURI]; diff --git a/src/BeSimple/SoapCommon/Mime/PartHeader.php b/src/BeSimple/SoapCommon/Mime/PartHeader.php index 958c85fd..da7c2d3e 100644 --- a/src/BeSimple/SoapCommon/Mime/PartHeader.php +++ b/src/BeSimple/SoapCommon/Mime/PartHeader.php @@ -86,7 +86,7 @@ public function getHeader($name, $subValue = null) */ protected function generateHeaders() { - $charset = strtolower($this->getHeader('Content-Type', 'charset')); + $charset = strtolower($this->getHeader('Content-Type', 'charset') ?? ''); $preferences = array( 'scheme' => 'Q', 'input-charset' => 'utf-8', diff --git a/src/BeSimple/SoapCommon/Tests/Mime/MultiPartTest.php b/src/BeSimple/SoapCommon/Tests/Mime/MultiPartTest.php index 96cd3665..d0358f1c 100644 --- a/src/BeSimple/SoapCommon/Tests/Mime/MultiPartTest.php +++ b/src/BeSimple/SoapCommon/Tests/Mime/MultiPartTest.php @@ -26,7 +26,7 @@ public function testConstructor() $this->assertEquals('multipart/related', $mp->getHeader('Content-Type')); $this->assertEquals('text/xml', $mp->getHeader('Content-Type', 'type')); $this->assertEquals('utf-8', $mp->getHeader('Content-Type', 'charset')); - $this->assertRegExp('~urn:uuid:.*~', $mp->getHeader('Content-Type', 'boundary')); + $this->assertMatchesRegularExpression('~urn:uuid:.*~', $mp->getHeader('Content-Type', 'boundary')); } public function testGetMimeMessage() diff --git a/src/BeSimple/SoapCommon/Tests/Mime/PartTest.php b/src/BeSimple/SoapCommon/Tests/Mime/PartTest.php index ab6a8a43..b2ceddda 100644 --- a/src/BeSimple/SoapCommon/Tests/Mime/PartTest.php +++ b/src/BeSimple/SoapCommon/Tests/Mime/PartTest.php @@ -36,7 +36,7 @@ public function testDefaultConstructor() $this->assertEquals('application/octet-stream', $p->getHeader('Content-Type')); $this->assertEquals('utf-8', $p->getHeader('Content-Type', 'charset')); $this->assertEquals(Part::ENCODING_BINARY, $p->getHeader('Content-Transfer-Encoding')); - $this->assertRegExp('~~', $p->getHeader('Content-ID')); + $this->assertMatchesRegularExpression('~~', $p->getHeader('Content-ID')); } public function testSetContent() diff --git a/src/BeSimple/SoapCommon/Tests/CacheTest.php b/src/BeSimple/SoapCommon/Tests/SoapRequestTest.php similarity index 92% rename from src/BeSimple/SoapCommon/Tests/CacheTest.php rename to src/BeSimple/SoapCommon/Tests/SoapRequestTest.php index 14a9cf96..2413f6c4 100644 --- a/src/BeSimple/SoapCommon/Tests/CacheTest.php +++ b/src/BeSimple/SoapCommon/Tests/SoapRequestTest.php @@ -18,9 +18,6 @@ class SoapRequestTest extends \PHPUnit\Framework\TestCase { - // when using the SetUpTearDownTrait, methods like doSetup() can - // be defined with and without the 'void' return type, as you wish - use \Symfony\Bridge\PhpUnit\SetUpTearDownTrait; public function testSetEnabled() { @@ -87,7 +84,7 @@ public function testSetLimit() $this->assertEquals(1, Cache::getLimit()); } - public function doSetUp() + public function setUp(): void { ini_restore('soap.wsdl_cache_enabled'); ini_restore('soap.wsdl_cache');