From dcedd104edb9911e74a10da5308c0a7b232832fa Mon Sep 17 00:00:00 2001 From: Hasin Hayder Date: Sun, 7 Jan 2024 16:07:54 +0600 Subject: [PATCH] Tests Updated --- .github/workflows/PHP8.0.yml | 43 ---------------------------- README.md | 2 +- phpunit.xml | 54 +++++++++++++++++------------------- tests/Feature/UserTest.php | 1 + 4 files changed, 27 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/PHP8.0.yml diff --git a/.github/workflows/PHP8.0.yml b/.github/workflows/PHP8.0.yml deleted file mode 100644 index 0f78db9..0000000 --- a/.github/workflows/PHP8.0.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: "PHP 8.0 Tests" - -on: [push, pull_request] - -jobs: - test: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [8.0] - - name: PHP${{ matrix.php }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv - coverage: none - - - name: Install dependencies - run: composer install - - - name: Create Environment file and generate app key - run: | - cp .env.example .env - - php artisan key:generate - - - name: Create database and run migration - run: | - touch database/hydra.sqlite - php artisan migrate - php artisan db:seed - - - name: Execute tests - run: vendor/bin/phpunit diff --git a/README.md b/README.md index a6d9781..85edf0f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![Hydra - Zero Config API Boilerplate with Laravel Sanctum](https://res.cloudinary.com/roxlox/image/upload/v1653133921/hydra/hydra-trnsparent_jcsl4l.png) # Hydra - Zero Config API Boilerplate with Laravel Sanctum -![PHP 8.0 Tests](https://img.shields.io/github/workflow/status/hasinhayder/hydra/PHP%208.0%20Tests?label=PHP%208.0) ![PHP 8.1 Tests](https://img.shields.io/github/workflow/status/hasinhayder/hydra/PHP%208.1%20Tests?label=PHP%208.1) [![CircleCI](https://circleci.com/gh/hasinhayder/hydra/tree/master.svg?style=svg)](https://circleci.com/gh/hasinhayder/hydra/tree/master) ![GitHub](https://img.shields.io/github/license/hasinhayder/hydra?label=License&style=flat-square) +![PHP 8.0 Tests](https://img.shields.io/github/workflow/status/hasinhayder/hydra/PHP%208.0%20Tests?label=PHP%208.0) ![PHP 8.1 Tests](https://img.shields.io/github/workflow/status/hasinhayder/hydra/PHP%208.1%20Tests?label=PHP%208.1) ![GitHub](https://img.shields.io/github/license/hasinhayder/hydra?label=License&style=flat-square) Hydra is a zero-config API boilerplate with Laravel Sanctum and comes with excellent user and role management API out of the box. Start your next big API project with Hydra, focus on building business logic, and save countless hours of writing boring user and role management API again and again. diff --git a/phpunit.xml b/phpunit.xml index 2ac86a1..c43deac 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,31 +1,27 @@ - - - - ./tests/Unit - - - ./tests/Feature - - - - - ./app - - - - - - - - - - - - - + + + + ./tests/Unit + + + ./tests/Feature + + + + + + + + + + + + + + + + ./app + + diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php index a0781fd..9bcceaa 100644 --- a/tests/Feature/UserTest.php +++ b/tests/Feature/UserTest.php @@ -60,6 +60,7 @@ public function test_new_user_login() { $response ->assertJson( fn (AssertableJson $json) => $json->where('error', 0) + ->has('name') ->has('token') ->has('id') );