diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ba177a8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + php-versions: + - 7.2 + - 7.3 + - 7.4 + - 8.0 + - 8.1 + - 8.2 + name: PHP ${{ matrix.php-versions }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + coverage: xdebug + php-version: ${{ matrix.php-versions }} + + - name: Install dependencies + run: composer update --prefer-dist --no-progress --no-suggest + + - name: Run tests + run: vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover + +# - name: Upload code coverage +# run: vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover diff --git a/.gitignore b/.gitignore index 47184ce..35be79b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build composer.lock docs -vendor \ No newline at end of file +vendor +.phpunit.result.cache diff --git a/README.md b/README.md index 6262ce5..7231da6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version](https://img.shields.io/github/tag/dragosprotung/php2wsdl.svg?style=flat-square)](https://github.com/dragosprotung/php2wsdl/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/travis/dragosprotung/php2wsdl/master.svg?style=flat-square)](https://travis-ci.org/dragosprotung/php2wsdl) +[![Build Status](https://github.com/dragosprotung/php2wsdl/actions/workflows/build.yml/badge.svg)](https://github.com/dragosprotung/php2wsdl/actions/workflows/build.yml) [![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/dragosprotung/php2wsdl.svg?style=flat-square)](https://scrutinizer-ci.com/g/dragosprotung/php2wsdl/code-structure) [![Quality Score](https://img.shields.io/scrutinizer/g/dragosprotung/php2wsdl.svg?style=flat-square)](https://scrutinizer-ci.com/g/dragosprotung/php2wsdl) [![Total Downloads](https://img.shields.io/packagist/dt/php2wsdl/php2wsdl.svg?style=flat-square)](https://packagist.org/packages/php2wsdl/php2wsdl) @@ -21,7 +21,7 @@ $ composer require php2wsdl/php2wsdl ``` php $class = "Vendor\\MyClass"; -$serviceURI = "http://www.myservice.com/soap"; +$serviceURI = "https://www.myservice.com/soap"; $wsdlGenerator = new PHP2WSDL\PHPClass2WSDL($class, $serviceURI); // Generate the WSDL from the class adding only the public methods that have @soap annotation. $wsdlGenerator->generateWSDL(true); @@ -34,7 +34,7 @@ $wsdlXML = $wsdlGenerator->save('foo/example.wsdl'); ## Testing ``` bash -$ phpunit +$ vendor/bin/simple-phpunit ``` ## Security diff --git a/composer.json b/composer.json index 6cbc388..3ba1176 100644 --- a/composer.json +++ b/composer.json @@ -19,11 +19,11 @@ } ], "require": { - "php": ">=5.6", + "php": ">=7.2", "wingu/reflection": "~1.0" }, "require-dev": { - "phpunit/phpunit": "~5.7", + "symfony/phpunit-bridge": "^6.0", "scrutinizer/ocular": "~1.1" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2e2dd9d..480d79f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,22 +1,21 @@ - - - - tests - - - - - src/ - - - - - - + + + + src/ + + + + + + + + + + tests + + + + + diff --git a/src/PHPClass2WSDL.php b/src/PHPClass2WSDL.php index 8b2419a..b3d23ed 100644 --- a/src/PHPClass2WSDL.php +++ b/src/PHPClass2WSDL.php @@ -250,7 +250,7 @@ protected function addMethodToWsdl(ReflectionMethod $method, DOMElement $port, D // Add any documentation for the operation. $description = $method->getReflectionDocComment()->getFullDescription(); - if (strlen($description) > 0) { + if (isset($description) && (strlen($description) > 0)) { $this->wsdl->addDocumentation($portOperation, $description); } diff --git a/tests/PHP2WSDLTest.php b/tests/PHP2WSDLTest.php index 9103307..adc99fe 100644 --- a/tests/PHP2WSDLTest.php +++ b/tests/PHP2WSDLTest.php @@ -3,8 +3,9 @@ namespace PHP2WSDL\Test; use PHP2WSDL\PHPClass2WSDL; +use PHPUnit\Framework\TestCase as BaseTestCase; -class PHP2WSDLTest extends \PHPUnit_Framework_TestCase +class PHP2WSDLTest extends BaseTestCase { public function testSimpleClassWithSoapTagAnnotations()