diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..48e4115 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,34 @@ +name: PHP Composer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Run test suite + run: vendor/bin/phpunit diff --git a/Tests/Service/Request/RequestFactoryTest.php b/Tests/Service/Request/RequestFactoryTest.php index b8543fb..76fb36f 100644 --- a/Tests/Service/Request/RequestFactoryTest.php +++ b/Tests/Service/Request/RequestFactoryTest.php @@ -264,7 +264,7 @@ public function testBuildFlowWithQueryParams() */ public function testBuildFlowValidationFailsOnUnmappedRequestArguments() { - $this->setExpectedException(InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $baseUrl = 'baseUrl'; $routeString = 'routeString\{invalidArgument}'; diff --git a/Tests/Service/Response/ResponseTransformerTest.php b/Tests/Service/Response/ResponseTransformerTest.php index f7e81e9..8bb00ab 100644 --- a/Tests/Service/Response/ResponseTransformerTest.php +++ b/Tests/Service/Response/ResponseTransformerTest.php @@ -114,7 +114,7 @@ public function testTransformSuccess() */ public function testTransformFails() { - static::setExpectedException(ResponseException::class); + $this->expectException(ResponseException::class); $responseBodyContent = '{$responseBodyContent:$responseBodyContent}'; $failedStatusCode = Response::HTTP_INTERNAL_SERVER_ERROR; diff --git a/composer.json b/composer.json index ed01e99..874d051 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "require-dev": { "symfony/yaml": "~3.0|~4.0|~5.0", "symfony/console": "~3.0|~4.0|~5.0", - "phpunit/phpunit": "^4.8", + "phpunit/phpunit": "^6.5", "symfony/phpunit-bridge": "^3.3.8", "phpspec/prophecy": "^1.7.2" },