Skip to content

Commit

Permalink
MNT Add support for symphony 4 and switch to shared travis config (#199)
Browse files Browse the repository at this point in the history
* MNT Add support for symphony 4 and switch to shared travis config

* Specify DB

* Update phpunit config

* Don't test php 8

* Pleasing PHP8

* Use correct syntax for composer OR constraints

* Doing the constraint right ... maybe

Co-authored-by: Steve Boyd <[email protected]>

Co-authored-by: Steve Boyd <[email protected]>
  • Loading branch information
Maxime Rainville and emteknetnz authored Mar 16, 2021
1 parent bc581dc commit efdd90b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
40 changes: 8 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
language: php
version: ~> 1.0

dist: xenial
import:
- silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-fixed.yml

sudo: false

cache:
directories:
- $HOME/.composer/cache/files
matrix:
include:
- php: 7.1
env: PHPUNIT_TEST=1
- php: 7.2
env: PHPUNIT_TEST=1
- php: 7.3
env: PHPUNIT_TEST=1 PHPCS_TEST=1
- php: 7.4
env: PHPUNIT_TEST=1



before_script:
- export PATH=~/.composer/vendor/bin:$PATH
- composer validate
- composer install --prefer-dist
- composer require --prefer-dist --no-update silverstripe/recipe-core:^4
- composer update
- if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi
- phpenv rehash

script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/php; fi
- if [[ $PHPCS_TEST ]]; then composer run-script lint; fi
env:
global:
- COMPOSER_ROOT_VERSION="1.x-dev"
- REQUIRE_RECIPE="4.x-dev"
- PHPUNIT_TEST=1
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"behat/mink": "^1.7",
"behat/mink-extension": "^2.1",
"silverstripe/mink-facebook-web-driver": "^1",
"symfony/dom-crawler": "^3",
"symfony/dom-crawler": "^3 || ^4",
"silverstripe/testsession": "^2.2",
"silverstripe/framework": "^4",
"symfony/finder": "^3.2"
"symfony/finder": "^3.2 || ^4"
},
"autoload": {
"psr-4": {
Expand Down
9 changes: 5 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<phpunit colors="true">
<testsuite name="Default">
<directory>tests/php</directory>
</testsuite>
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests/php</directory>
</testsuite>
</phpunit>
2 changes: 1 addition & 1 deletion src/Context/SilverStripeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ abstract class SilverStripeContext extends MinkContext implements SilverStripeAw
*/
public function __construct(array $parameters = null)
{
if (!preg_match('/\\FeatureContext$/', get_class($this))) {
if (!preg_match('/\\\FeatureContext$/', get_class($this))) {
throw new InvalidArgumentException(
'Subclasses of SilverStripeContext must be named FeatureContext. Found "' . get_class($this) . '""'
);
Expand Down

0 comments on commit efdd90b

Please sign in to comment.