-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '61d69640dade0f6f22a3d89393718b126c377757' as 'php-serve…
…r-sdk-shared-tests'
- Loading branch information
Showing
8 changed files
with
555 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
version: 2.1 | ||
|
||
workflows: | ||
workflow: | ||
jobs: | ||
- linux-test: | ||
name: PHP 7.3 | ||
docker-image: cimg/php:7.3 | ||
- linux-test: | ||
name: PHP 7.4 | ||
docker-image: cimg/php:7.4 | ||
- linux-test: | ||
name: PHP 8.0 | ||
docker-image: cimg/php:8.0 | ||
|
||
jobs: | ||
linux-test: | ||
parameters: | ||
docker-image: | ||
type: string | ||
|
||
docker: | ||
- image: <<parameters.docker-image>> | ||
|
||
steps: | ||
- checkout | ||
- run: | ||
name: install dependencies | ||
command: composer install --no-progress | ||
- run: mkdir -p ./phpunit | ||
- run: | ||
name: run tests | ||
command: php vendor/bin/phpunit | ||
- store_test_results: | ||
path: ./phpunit | ||
- store_artifacts: | ||
path: ./phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
vendor/ | ||
composer.lock | ||
phpunit/ | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2021 Catamorphic, Co. | ||
|
||
Licensed 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# LaunchDarkly Server-Side PHP SDK Shared Test Code | ||
|
||
[![CircleCI](https://circleci.com/gh/launchdarkly/php-server-sdk-shared-tests.svg?style=svg)](https://circleci.com/gh/launchdarkly/php-server-sdk-shared-tests) | ||
|
||
This project provides support code for testing LaunchDarkly PHP SDK integrations. Feature store implementations, etc., should use this code whenever possible to ensure consistent test coverage and avoid repetition. An example of a project using this code is [php-server-sdk-redis](https://github.com/launchdarkly/php-server-sdk-redis). | ||
|
||
The code is not published to Packagist, since it isn't of any use in any non-test context. Instead, it's meant to be used as a Git subtree. Add the subtree to your project like this: | ||
|
||
git remote add php-server-sdk-shared-tests [email protected]:launchdarkly/php-server-sdk-shared-tests.git | ||
git subtree add --squash --prefix=php-server-sdk-shared-tests/ php-server-sdk-shared-tests master | ||
|
||
Then, in your project that uses the shared tests, add this to `composer.json`: | ||
|
||
```json | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "php-server-sdk-shared-tests" | ||
}, | ||
], | ||
``` | ||
|
||
And add this dependency: | ||
|
||
```json | ||
"launchdarkly/server-sdk-shared-tests": "dev-master" | ||
``` | ||
|
||
To update the copy of `php-server-sdk-shared-tests` in your repository to reflect changes in this one: | ||
|
||
git subtree pull --squash --prefix=php-server-sdk-shared-tests/ php-server-sdk-shared-tests master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "launchdarkly/server-sdk-shared-tests", | ||
"description": "Shared unit test code for LaunchDarkly PHP SDK", | ||
"license": "Apache-2.0", | ||
"authors": [ | ||
{ | ||
"name": "LaunchDarkly <[email protected]>", | ||
"homepage": "http://launchdarkly.com/" | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.3" | ||
}, | ||
"require-dev": { | ||
"launchdarkly/server-sdk": "4.*", | ||
"phpunit/phpunit": "^9" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"LaunchDarkly\\SharedTest\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"LaunchDarkly\\SharedTest\\Tests\\": "tests/" | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"scripts": { | ||
"cs": "vendor/bin/php-cs-fixer fix --diff --verbose" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" beStrictAboutChangesToGlobalState="true" beStrictAboutOutputDuringTests="true" beStrictAboutResourceUsageDuringSmallTests="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutTodoAnnotatedTests="true" verbose="true"> | ||
|
||
<logging> | ||
<junit outputFile="phpunit/junit.xml"/> | ||
</logging> | ||
|
||
<testsuites> | ||
<testsuite name="Unit Tests"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
Oops, something went wrong.