diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..3d0bf86 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,49 @@ +name: run-tests + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + php: [8.4, 8.3, 8.2] + laravel: [11.*, 10.*] + stability: [prefer-lowest, prefer-stable] + include: + - laravel: 11.* + testbench: 9.* + - laravel: 10.* + testbench: 8.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + coverage: none + + - name: Setup problem matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "nesbot/carbon:^2.64" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction + + - name: Execute tests + run: vendor/bin/phpunit \ No newline at end of file diff --git a/.gitignore b/.gitignore index 30c2b7b..c909102 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ composer.lock composer.phar Thumbs.db phpunit.xml +.phpunit.cache diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index 0249f86..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: php - -sudo: false - -dist: trusty - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -before_script: - - composer self-update - - composer install --prefer-dist --no-interaction - -script: ./vendor/bin/phpunit -d memory_limit=1024M - -matrix: - fast_finish: true diff --git a/README.md b/README.md index 4babdbd..15b08b1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ [![Join the chat at https://gitter.im/mcamara/laravel-localization](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mcamara/laravel-localization?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Latest Stable Version](https://poser.pugx.org/mcamara/laravel-localization/version.png)](https://packagist.org/packages/mcamara/laravel-localization) [![Total Downloads](https://poser.pugx.org/mcamara/laravel-localization/d/total.png)](https://packagist.org/packages/mcamara/laravel-localization) [![Build Status](https://travis-ci.org/mcamara/laravel-localization.png)](https://travis-ci.org/mcamara/laravel-localization) +[![Latest Stable Version](https://poser.pugx.org/mcamara/laravel-localization/version.png)](https://packagist.org/packages/mcamara/laravel-localization) +[![Total Downloads](https://poser.pugx.org/mcamara/laravel-localization/d/total.png)](https://packagist.org/packages/mcamara/laravel-localization) +![GitHub Actions](https://github.com/mcamara/laravel-localization/actions/workflows/run-tests.yml/badge.svg) [![Open Source Helpers](https://www.codetriage.com/mcamara/laravel-localization/badges/users.svg)](https://www.codetriage.com/mcamara/laravel-localization) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 27c19b6..0000000 --- a/circle.yml +++ /dev/null @@ -1,3 +0,0 @@ -machine: - php: - version: 7.0.4 diff --git a/composer.json b/composer.json index 1c78358..aed23a8 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "laravel/framework": "~5.2.0||~5.3.0||~5.4.0||~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0||^7.0||^8.0||^9.0|^10.0||^11.0" }, "require-dev": { - "orchestra/testbench-browser-kit": "~3.4|~3.8|~4.0|^7.12|^8.5", + "orchestra/testbench-browser-kit": "~3.4|~3.8|~4.0|^7.12|^8.5|^9.0", "phpunit/phpunit": "6.0.*|^8.0|^9.5.10|^10.0" }, "suggest": { @@ -35,6 +35,11 @@ "Mcamara\\LaravelLocalization": "src/" } }, + "autoload-dev": { + "psr-4": { + "Mcamara\\LaravelLocalization\\Tests\\": "tests" + } + }, "extra": { "laravel": { "providers": [ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 931dca3..fe86ad2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,23 +1,23 @@ - - ./tests/ + tests - - - + + ./src/Mcamara - - + + diff --git a/tests/.gitkeep b/tests/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/LocalizerTests.php b/tests/LaravelLocalizationTest.php similarity index 98% rename from tests/LocalizerTests.php rename to tests/LaravelLocalizationTest.php index 54eee63..a3f8e3d 100644 --- a/tests/LocalizerTests.php +++ b/tests/LaravelLocalizationTest.php @@ -1,8 +1,11 @@ 'Mcamara\LaravelLocalization\Facades\LaravelLocalization', - ]; - } - - public function setUp(): void - { - parent::setUp(); - } - /** * Set routes for testing. * diff --git a/tests/ModelWithTranslatableRoutes.php b/tests/ModelWithTranslatableRoutes.php index fc3ddca..4089dfc 100644 --- a/tests/ModelWithTranslatableRoutes.php +++ b/tests/ModelWithTranslatableRoutes.php @@ -1,5 +1,7 @@ LaravelLocalization::class, + ]; + } +}