diff --git a/.github/workflows/exercise-tests-phpunit-10.yml b/.github/workflows/exercise-tests-phpunit-10.yml index 2c777740d..72c720433 100644 --- a/.github/workflows/exercise-tests-phpunit-10.yml +++ b/.github/workflows/exercise-tests-phpunit-10.yml @@ -14,10 +14,8 @@ jobs: strategy: fail-fast: false matrix: - #php-version: [8.1, 8.2, 8.3] - php-version: [8.3] - #os: [ubuntu-22.04, windows-2022, macOS-12] - os: [ubuntu-22.04] + php-version: [8.1, 8.2, 8.3] + os: [ubuntu-22.04, windows-2022, macOS-14] steps: - name: Set git line endings diff --git a/.github/workflows/exercise-tests-phpunit-9.yml b/.github/workflows/exercise-tests-phpunit-9.yml deleted file mode 100644 index 4746e824c..000000000 --- a/.github/workflows/exercise-tests-phpunit-9.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Exercise tests with PHPUnit 9 - -on: - workflow_dispatch: - push: - branches: - - main - - master - pull_request: - -jobs: - test: - name: PHP ${{ matrix.php-version }} - ${{ matrix.os }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - php-version: [8.0, 8.1, 8.2] - os: [ubuntu-22.04, windows-2022] - - steps: - - name: Set git line endings - if: ${{ matrix.os == 'windows-2022' }} - run: | - git config --system core.autocrlf false - git config --system core.eol lf - - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - - - uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 - with: - php-version: ${{ matrix.php-version }} - extensions: gmp - - - name: Install dependencies - shell: bash - run: | - curl -Lo ./bin/phpunit-9.phar https://phar.phpunit.de/phpunit-9.phar - chmod +x bin/phpunit-9.phar - - - name: Test exercises\ - shell: bash - env: - PHPUNIT_BIN: 'bin/phpunit-9.phar' - run: bin/test.sh diff --git a/README.md b/README.md index 7c5d0a883..bea83633c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The following system dependencies are required: - `composer`, as recommended in the [PHP track installation docs][exercism-track-installation-composer]. - [`bash` shell][gnu-bash]. -- PHP V8.2+ CLI. +- PHP V8.3+ CLI. - An active Internet connection for installing required tools / composer packages. Run the following command to get started with this project: diff --git a/composer.json b/composer.json index 695a71d98..ee007c67f 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,8 @@ } }, "require-dev": { - "php": "^8.0", - "phpunit/phpunit": "^9.6 || ^10.5", + "php": "^8.1", + "phpunit/phpunit": "^10.5", "slevomat/coding-standard": "^8.14.1", "squizlabs/php_codesniffer": "^3.9" }, diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 7dd5a4c57..91f4df85b 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -2,49 +2,60 @@ ## Which version to chose? -We encourage to use a stable PHP release with active support. Currently this is **PHP 8.0, 8.1 and 8.2**. Details on current releases and their timelines can be found at [php.net/supported-versions](https://www.php.net/supported-versions.php). +We encourage to use a stable PHP release with active support. +Currently this is **PHP 8.1, 8.2 and 8.3**. +Details on current releases and their timelines can be found in [the official PHP documentation](https://www.php.net/supported-versions.php). ## Install PHP +Most package managers for Linux / macOS provide pre-built packages. PHP can be downloaded and built from source, available at [php.net/downloads.php](https://php.net/downloads.php) or [windows.php.net/download](https://windows.php.net/download). -> Note: A web server such as nginx or Apache HTTP server is not required to complete the exercises. +~~~~exercism/note +A web server such as nginx or Apache HTTP server is not required to complete the exercises. +~~~~ ### Linux -Different distributions have different methods. You should be able to +Different distributions have different methods. +You should be able to -```bash -$ yum install php +```shell +yum install php ``` or -```bash -$ apt-get install php +```shell +apt-get install php ``` -depending on your repository manager. +depending on your package manager. -For further instructions, read the manual on [Installation on Unix systems](https://www.php.net/manual/en/install.unix.php). +For further instructions, read the PHP manual on [Installation on Unix systems](https://www.php.net/manual/en/install.unix.php). ### macOS -While PHP is often bundled with macOS, it is often outdated. We recommended installing PHP through [Homebrew](https://brew.sh/). You can install Homebrew following the instructions [here](https://brew.sh/#install). +While PHP is often bundled with macOS, it is often outdated. +We recommended installing PHP through [Homebrew](https://brew.sh/). +You can install Homebrew following the instructions [here](https://brew.sh/#install). -To confirm its installation try the following command, it should output Homebrew `3.2.x` at the time of this writing. -```bash -$ brew --version +To confirm its installation try the following command, it should output Homebrew `4.2.x` at the time of this writing. + +```shell +brew --version ``` Install PHP via homebrew -```bash -$ brew install php@8.0 + +```shell +brew install php@8.3 ``` -This should display the now installed version of PHP, at least version `8.0.x`. -```bash -$ php -v +This should display the now installed version of PHP, at least version `8.1.0`. + +```shell +php -v ``` For further instructions, read the manual on [Installation on macOS](https://www.php.net/manual/en/install.macosx.php). @@ -66,21 +77,22 @@ You will also need [Docker](https://docs.docker.com/engine/install/). If you want to use a different OS, see instruction on [php.net/manual/en/install](https://www.php.net/manual/en/install.php). -### Install Composer -Install [Composer](https://getcomposer.org) [here](https://getcomposer.org/doc/00-intro.md) following your devices OS installation instructions. We recommend installing it globally for ease of use. +## Install Composer + +Install [Composer](https://getcomposer.org) following your devices OS [installation instructions](https://getcomposer.org/doc/00-intro.md). We recommend installing it globally for ease of use. -### Install PHPUnit +## Install PHPUnit -#### Via Composer +### Via Composer -PHPUnit version 9 can be installed globally via [Composer](https://getcomposer.org), using the following command. +PHPUnit version 10 can be installed globally via [Composer](https://getcomposer.org), using the following command: -```bash -> composer global require phpunit/phpunit ^9 +```shell +composer global require phpunit/phpunit ^10.5 ``` -If you are using PHP 8+ make sure you install at version 9.5 or later. +Please make sure you install version 10.5 or later. -#### Manual installation +### Manual installation -If you are not using Composer package manager, follow the official [Installing PHPUnit instructions](https://phpunit.readthedocs.io/en/9.5/installation.html). +If you are not using Composer package manager, follow the official [Installing PHPUnit instructions](https://docs.phpunit.de/en/10.5/installation.html#installing-phpunit). diff --git a/docs/TESTS.md b/docs/TESTS.md index eab79c629..a0f3b7e39 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -3,11 +3,11 @@ Execute the tests with: ```shell -> phpunit file_to_test.php +phpunit test_file.php ``` -For example, to run the tests for the Hello World exercise, you would run: +For example, to run the tests for the Hello World exercise, you would run: -``` -$ phpunit HellowWorldTest.php +```shell +phpunit HelloWorldTest.php ``` diff --git a/exercises/shared/.docs/tests.md b/exercises/shared/.docs/tests.md index 1551deaef..8527d5e85 100644 --- a/exercises/shared/.docs/tests.md +++ b/exercises/shared/.docs/tests.md @@ -3,21 +3,20 @@ 1. Go to the root of your PHP exercise directory, which is `/php`. To find the Exercism workspace run - ➜ exercism debug | grep Workspace + exercism debug | grep Workspace -1. Get [PHPUnit] if you don't have it already. +2. Get [PHPUnit] if you don't have it already. - ➜ wget -O phpunit https://phar.phpunit.de/phpunit-9.phar - ➜ chmod +x phpunit - ➜ ./phpunit --version + wget -O phpunit https://phar.phpunit.de/phpunit-10.phar + chmod +x phpunit + ./phpunit --version -2. Execute the tests: +3. Execute the tests: - ➜ ./phpunit file_to_test.php + ./phpunit test_file.php For example, to run the tests for the Hello World exercise, you would run: - ➜ ./phpunit HelloWorldTest.php + ./phpunit HelloWorldTest.php [PHPUnit]: https://phpunit.de -