diff options
author | Jean-Michel Vedrine <vedrine@vedrine.org> | 2017-12-27 08:30:49 +0100 |
---|---|---|
committer | Jean-Michel Vedrine <vedrine@vedrine.org> | 2017-12-27 08:30:49 +0100 |
commit | 6900c148855bb618e44f490e65dbdcd7c98e8619 (patch) | |
tree | fb5de21136b9d83338b3eeff10321d45d8f64a56 | |
parent | fce013e113eb0587d7b8885020670e9ff9ae2d03 (diff) |
Add phpunit and Travis files
-rw-r--r-- | .travis.yml | 47 | ||||
-rw-r--r-- | phpunit.xml | 37 |
2 files changed, 84 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1c89428 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,47 @@ +language: php + +sudo: false + +cache: + directories: + - $HOME/.composer/cache + +php: + - 5.6 + - 7.0 + - 7.1 + +addons: + firefox: "47.0.1" + postgresql: "9.3" + +env: + global: + - MOODLE_BRANCH=MOODLE_34_STABLE + matrix: + - DB=pgsql + - DB=mysqli + + + +before_install: + - phpenv config-rm xdebug.ini + - cd ../.. + - composer selfupdate + - composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^1 + - export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" + +install: + - moodle-plugin-ci install +script: + - moodle-plugin-ci phplint + - moodle-plugin-ci csslint + # - moodle-plugin-ci stylelint + - moodle-plugin-ci jshint + - moodle-plugin-ci phpcpd + - moodle-plugin-ci phpmd + - moodle-plugin-ci codechecker +# - moodle-plugin-ci shifter + - moodle-plugin-ci validate + - moodle-plugin-ci phpunit + - moodle-plugin-ci behat
\ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..593f644 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../lib/phpunit/phpunit.xsd" + bootstrap="../../../lib/phpunit/bootstrap.php" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + backupGlobals="false" + backupStaticAttributes="false" + stopOnError="false" + stopOnFailure="false" + stopOnIncomplete="false" + stopOnSkipped="false" + strict="false" + printerClass="Hint_ResultPrinter" + testSuiteLoaderClass="phpunit_autoloader" + > + + <php> + <!--<const name="PHPUNIT_LONGTEST" value="1"/> uncomment to execute also slow or otherwise expensive tests--> + <const name="PHPUNIT_SEQUENCE_START" value="139000"/> + + <!--Following constants instruct tests to fetch external test files from alternative location or skip tests if empty, clone https://github.com/moodlehq/moodle-exttests to local web server--> + <!--<const name="TEST_EXTERNAL_FILES_HTTP_URL" value="http://download.moodle.org/unittest"/> uncomment and alter to fetch external test files from alternative location--> + <!--<const name="TEST_EXTERNAL_FILES_HTTPS_URL" value="https://download.moodle.org/unittest"/> uncomment and alter to fetch external test files from alternative location--> + </php> + + + <testsuites> + <testsuite name="\question\type\algebra"> + <directory suffix="_test.php">.</directory> + </testsuite> + </testsuites> + +</phpunit> |