diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 27bc04e..6350ebe 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} @@ -18,6 +18,6 @@ jobs: args: --config=.php-cs-fixer.php --allow-risky=yes - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Fix styling \ No newline at end of file diff --git a/.github/workflows/run-tests-mysql.yml b/.github/workflows/run-tests-mysql.yml index 7ebcb3d..fe815ee 100644 --- a/.github/workflows/run-tests-mysql.yml +++ b/.github/workflows/run-tests-mysql.yml @@ -1,23 +1,21 @@ name: MySQL Tests -on: [push, pull_request] +on: + - push + - pull_request jobs: laravel-tests: runs-on: ubuntu-latest - # Service container Mysql mysql + services: - # Label used to access the service container mysql: - # Docker Hub image (also with version) image: mysql:8.0 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: db_test_laravel - ## map the "external" 33306 port with the "internal" 3306 + MYSQL_DATABASE: db_test_laravel ports: - 33306:3306 - # Set health checks to wait until mysql database has started (it takes some seconds to start) options: >- --health-cmd="mysqladmin ping" --health-interval=10s @@ -28,50 +26,54 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: [ '8.2', '8.1' ] - dependency-stability: [ prefer-stable ] - - laravel: [ '10.*', '9.*' ] + php-versions: ['8.1', '8.2', '8.3'] + dependency-stability: [prefer-stable] + laravel: ['9.*', '10.*', '11.*'] include: + - laravel: 9.* + testbench: 7.* - laravel: 10.* testbench: 8.* - - laravel: 9.* - testbench: 7.* + - laravel: 11.* + testbench: 9.* exclude: - laravel: 10.* php-versions: 8.0 + - laravel: 11.* + php-versions: 8.1 name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Install PHP versions uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + - name: Get Composer Cache Directory 2 id: composer-cache run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + + - uses: actions/cache@v4 id: actions-cache with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer- + - name: Install Laravel Dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction --no-suggest + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --dev + composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction - # Code quality - name: Execute tests (Unit and Feature tests) via PHPUnit - # Set environment env: DB_CONNECTION: mysql DB_DATABASE: db_test_laravel DB_PORT: 33306 DB_USERNAME: root - - run: vendor/bin/phpunit --testdox \ No newline at end of file + run: vendor/bin/phpunit --testdox diff --git a/.github/workflows/run-tests-postgres.yml b/.github/workflows/run-tests-postgres.yml index 6db817a..a04b29e 100644 --- a/.github/workflows/run-tests-postgres.yml +++ b/.github/workflows/run-tests-postgres.yml @@ -1,24 +1,22 @@ -name: PostgreSQL Tests +name: PostgreSQL Tests -on: [push, pull_request] +on: + - push + - pull_request jobs: laravel-tests: runs-on: ubuntu-latest - # Service container Postgresql postgresql + services: - # Label used to access the service container postgres: - # Docker Hub image (also with version) image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - POSTGRES_DB: db_test_laravel - ## map the "external" 55432 port with the "internal" 5432 + POSTGRES_DB: db_test_laravel ports: - 55432:5432 - # Set health checks to wait until postgresql database has started (it takes some seconds to start) options: >- --health-cmd pg_isready --health-interval 10s @@ -29,63 +27,68 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: [ '8.2', '8.1' ] - dependency-stability: [ prefer-stable ] - - laravel: [ '10.*', '9.*'] + php-versions: ['8.1', '8.2', '8.3'] + dependency-stability: [prefer-stable] + laravel: ['9.*', '10.*', '11.*'] include: + - laravel: 9.* + testbench: 7.* - laravel: 10.* testbench: 8.* - - laravel: 9.* - testbench: 7.* + - laravel: 11.* + testbench: 9.* exclude: - laravel: 10.* php-versions: 8.0 + - laravel: 11.* + php-versions: 8.1 name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Install PHP versions uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + - name: Get Composer Cache Directory 2 id: composer-cache run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + + - uses: actions/cache@v4 id: actions-cache with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer- + - name: Cache PHP dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 id: vendor-cache with: path: vendor key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} + - name: Install Laravel Dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction --no-suggest - + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --dev + composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction - name: Show dir run: pwd + - name: PHP Version run: php --version - # Code quality - name: Execute tests (Unit and Feature tests) via PHPUnit - # Set environment env: DB_CONNECTION: pgsql DB_DATABASE: db_test_laravel DB_PORT: 55432 DB_USERNAME: postgres DB_PASSWORD: postgres - - run: vendor/bin/phpunit --testdox \ No newline at end of file + run: vendor/bin/phpunit --testdox diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ea5cebc..38c052d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,6 +1,8 @@ name: SQLite Tests -on: [push, pull_request] +on: + - push + - pull_request jobs: laravel-tests: @@ -10,34 +12,44 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: [ '8.2', '8.1', '8.0', '7.4', '7.3', '7.2' ] - dependency-stability: [ prefer-stable ] - laravel: [ '10.*', '9.*', '8.*', '7.*', '6.*' ] - + php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + dependency-stability: [prefer-stable] + laravel: ['6.*', '7.*', '8.*', '9.*', '10.*', '11.*'] include: + - laravel: 6.* + testbench: 4.* + dbal: ^2.6 + - laravel: 7.* + testbench: 5.* + dbal: ^2.6 + - laravel: 8.* + testbench: 6.* + dbal: ^3.1.2|^2.13.3 + - laravel: 9.* + testbench: 7.* + dbal: ^3.1.2 - laravel: 10.* testbench: 8.* dbal: ^3.1.2 - - laravel: 9.* - testbench: 7.* + - laravel: 11.* + testbench: 9.* dbal: ^3.1.2 - - laravel: 8.* - testbench: 6.* - dbal: ^3.1.2|^2.13.3 - - laravel: 7.* - testbench: 5.* - dbal: ^2.6 - - laravel: 6.* - testbench: 4.* - dbal: ^2.6 exclude: - - laravel: 10.* + - laravel: 6.* + php-versions: 8.1 + - laravel: 6.* + php-versions: 8.2 + - laravel: 6.* + php-versions: 8.3 + - laravel: 7.* + php-versions: 8.1 + - laravel: 7.* + php-versions: 8.2 + - laravel: 7.* + php-versions: 8.3 + - laravel: 7.* php-versions: 8.0 - - laravel: 10.* - php-versions: 7.4 - - laravel: 10.* - php-versions: 7.3 - - laravel: 10.* + - laravel: 8.* php-versions: 7.2 - laravel: 9.* php-versions: 7.2 @@ -45,48 +57,55 @@ jobs: php-versions: 7.3 - laravel: 9.* php-versions: 7.4 - - laravel: 8.* + - laravel: 10.* + php-versions: 8.0 + - laravel: 10.* php-versions: 7.2 - - laravel: 7.* - php-versions: 8.2 - - laravel: 7.* - php-versions: 8.1 - - laravel: 7.* + - laravel: 10.* + php-versions: 7.3 + - laravel: 10.* + php-versions: 7.4 + - laravel: 11.* php-versions: 8.0 - - laravel: 6.* - php-versions: 8.2 - - laravel: 6.* + - laravel: 11.* php-versions: 8.1 + - laravel: 11.* + php-versions: 7.2 + - laravel: 11.* + php-versions: 7.3 + - laravel: 11.* + php-versions: 7.4 name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Install PHP versions uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + - name: Get Composer Cache Directory 2 id: composer-cache run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + + - uses: actions/cache@v4 id: actions-cache with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer- + - name: Install Laravel Dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update - composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction --no-suggest + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update --dev + composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction - # Code quality - name: Execute tests (Unit and Feature tests) via PHPUnit - # Set environment env: DB_CONNECTION: sqlite DB_DATABASE: ":memory:" - - run: vendor/bin/phpunit --testdox \ No newline at end of file + run: vendor/bin/phpunit --testdox diff --git a/composer.json b/composer.json index d5bc01e..f4b6479 100644 --- a/composer.json +++ b/composer.json @@ -18,16 +18,16 @@ ], "require": { "php": "^7.2|^8.0", - "illuminate/config": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/database": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0" + "illuminate/config": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/database": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0" }, "require-dev": { "doctrine/dbal": "^3.1.2|^2.13.3", "fakerphp/faker": "^1.16|^1.9.1", "friendsofphp/php-cs-fixer": "^3.2|^2.18", - "orchestra/testbench": "^3.0|^4.0|^5.0|^6.0|^7.0|^8.0", - "phpunit/phpunit": "^8.0|^9.3.3" + "orchestra/testbench": "^3.0|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^8.0|^9.3.3|^10.5" }, "autoload": { "psr-4": { diff --git a/tests/CustomModelsTest.php b/tests/CustomModelsTest.php index 6f1d16e..b5b7bed 100644 --- a/tests/CustomModelsTest.php +++ b/tests/CustomModelsTest.php @@ -42,7 +42,7 @@ public function it_can_use_custom_table(): void $this->setMessageCustomModel(); $this->setMessageCustomTable(); - $this->assertEquals('custom_messages', Models::table('messages')); + $this->assertSame('custom_messages', Models::table('messages')); $this->unsetMessageCustomModel(); $this->unsetMessageCustomTable(); @@ -53,7 +53,7 @@ public function it_should_return_custom_name_when_not_available(): void { $modelName = 'ModelNotFound'; - $this->assertEquals('ModelNotFound', Models::classname($modelName)); + $this->assertSame('ModelNotFound', Models::classname($modelName)); } /** :TODO: test */ @@ -61,7 +61,7 @@ public function it_can_get_custom_model_table_property(): void { $this->setMessageCustomModel(); - $this->assertEquals('custom_messages', Models::message()->getTable()); + $this->assertSame('custom_messages', Models::message()->getTable()); $this->unsetMessageCustomModel(); } diff --git a/tests/EloquentMessageTest.php b/tests/EloquentMessageTest.php index f5a6411..db37d92 100644 --- a/tests/EloquentMessageTest.php +++ b/tests/EloquentMessageTest.php @@ -18,6 +18,6 @@ public function it_should_get_the_recipients_of_a_message(): void $thread->participants()->saveMany([$user_1, $user_2, $user_3]); - $this->assertEquals(2, $message->recipients()->count()); + $this->assertSame(2, $message->recipients()->count()); } } diff --git a/tests/EloquentThreadTest.php b/tests/EloquentThreadTest.php index 1f7d1ab..8512785 100644 --- a/tests/EloquentThreadTest.php +++ b/tests/EloquentThreadTest.php @@ -39,9 +39,9 @@ public function search_specific_thread_by_subject(): void $threads = Thread::getBySubject('first subject'); - $this->assertEquals(1, $threads->count()); - $this->assertEquals(1, $threads->first()->id); - $this->assertEquals('first subject', $threads->first()->subject); + $this->assertSame(1, $threads->count()); + $this->assertSame(1, $threads->first()->id); + $this->assertSame('first subject', $threads->first()->subject); } /** @test */ @@ -52,23 +52,23 @@ public function search_threads_by_subject(): void $threads = Thread::getBySubject('%subject'); - $this->assertEquals(2, $threads->count()); + $this->assertSame(2, $threads->count()); - $this->assertEquals(1, $threads->first()->id); - $this->assertEquals('first subject', $threads->first()->subject); + $this->assertSame(1, $threads->first()->id); + $this->assertSame('first subject', $threads->first()->subject); - $this->assertEquals(2, $threads->last()->id); - $this->assertEquals('second subject', $threads->last()->subject); + $this->assertSame(2, $threads->last()->id); + $this->assertSame('second subject', $threads->last()->subject); } /** @test */ public function it_should_create_a_new_thread(): void { $thread = $this->threadFactory(); - $this->assertEquals('Sample thread', $thread->subject); + $this->assertSame('Sample thread', $thread->subject); $thread = $this->threadFactory(['subject' => 'Second sample thread']); - $this->assertEquals('Second sample thread', $thread->subject); + $this->assertSame('Second sample thread', $thread->subject); } /** @test */ @@ -85,7 +85,7 @@ public function it_should_return_the_latest_message(): void $thread = $this->threadFactory(); $thread->messages()->saveMany([$oldMessage, $newMessage]); - $this->assertEquals($newMessage->body, $thread->latestMessage->body); + $this->assertSame($newMessage->body, $thread->latestMessage->body); } /** @test */ @@ -117,11 +117,11 @@ public function it_should_get_all_thread_participants(): void $participantIds = $thread->participantsUserIds(); $this->assertCount(3, $participantIds); - $this->assertEquals(2, $participantIds[1]); + $this->assertSame(2, (int) $participantIds[1]); $participantIds = $thread->participantsUserIds(999); $this->assertCount(4, $participantIds); - $this->assertEquals(999, end($participantIds)); + $this->assertSame(999, end($participantIds)); $this->assertIsArray($participantIds); } @@ -254,7 +254,7 @@ public function it_should_add_a_participant_to_a_thread(): void $thread->addParticipant($participant); - $this->assertEquals(1, $thread->participants()->count()); + $this->assertSame(1, $thread->participants()->count()); } /** @test */ @@ -266,7 +266,7 @@ public function it_should_add_participants_to_a_thread_with_array(): void $thread->addParticipant($participants); - $this->assertEquals(3, $thread->participants()->count()); + $this->assertSame(3, $thread->participants()->count()); } /** @test */ @@ -276,7 +276,7 @@ public function it_should_add_participants_to_a_thread_with_arguments(): void $thread->addParticipant(1, 2); - $this->assertEquals(2, $thread->participants()->count()); + $this->assertSame(2, $thread->participants()->count()); } /** @test */ @@ -291,7 +291,7 @@ public function it_should_mark_the_participant_as_read(): void $thread->markAsRead($userId); - $this->assertNotEquals($thread->getParticipantFromUser($userId)->last_read, $last_read); + $this->assertNotSame($thread->getParticipantFromUser($userId)->last_read, $last_read); } /** @test */ @@ -355,12 +355,12 @@ public function it_should_activate_all_deleted_participants(): void $thread->participants()->saveMany([$user_1, $user_2, $user_3]); $participants = $thread->participants(); - $this->assertEquals(0, $participants->count()); + $this->assertSame(0, $participants->count()); $thread->activateAllParticipants(); $participants = $thread->participants(); - $this->assertEquals(3, $participants->count()); + $this->assertSame(3, $participants->count()); } /** @test */ @@ -375,18 +375,18 @@ public function it_should_generate_participant_select_string(): void $expectedString = '(' . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . '.name) as name'; if (config('database.connections.testbench.driver') === 'mysql') { - $this->assertEquals('concat' . $expectedString, $select); + $this->assertSame('concat' . $expectedString, $select); } else { - $this->assertEquals($expectedString, $select); + $this->assertSame($expectedString, $select); } $columns = ['name', 'email']; $select = $method->invokeArgs($thread, [$columns]); if (config('database.connections.testbench.driver') === 'mysql') { - $this->assertEquals('concat(' . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . ".name, ' ', " . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . '.email) as name', $select); + $this->assertSame('concat(' . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . ".name, ' ', " . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . '.email) as name', $select); } else { - $this->assertEquals('(' . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . ".name || ' ' || " . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . '.email) as name', $select); + $this->assertSame('(' . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . ".name || ' ' || " . Eloquent::getConnectionResolver()->getTablePrefix() . $tableName . '.email) as name', $select); } } @@ -404,13 +404,13 @@ public function it_should_get_participants_string(): void $thread->participants()->saveMany([$participant_1, $participant_2, $participant_3]); $string = $thread->participantsString(); - $this->assertEquals('Chris Gmyr, Adam Wathan, Taylor Otwell', $string); + $this->assertSame('Chris Gmyr, Adam Wathan, Taylor Otwell', $string); $string = $thread->participantsString(1); - $this->assertEquals('Adam Wathan, Taylor Otwell', $string); + $this->assertSame('Adam Wathan, Taylor Otwell', $string); $string = $thread->participantsString(1, ['email']); - $this->assertEquals('adam@test.com, taylor@test.com', $string); + $this->assertSame('adam@test.com, taylor@test.com', $string); } /** @test */ @@ -440,7 +440,7 @@ public function it_should_remove_a_single_participant(): void $thread->removeParticipant(2); - $this->assertEquals(1, $thread->participants()->count()); + $this->assertSame(1, $thread->participants()->count()); } /** @test */ @@ -455,7 +455,7 @@ public function it_should_remove_a_group_of_participants_with_array(): void $thread->removeParticipant([1, 2]); - $this->assertEquals(0, $thread->participants()->count()); + $this->assertSame(0, $thread->participants()->count()); } /** @test */ @@ -470,7 +470,7 @@ public function it_should_remove_a_group_of_participants_with_arguments(): void $thread->removeParticipant(1, 2); - $this->assertEquals(0, $thread->participants()->count()); + $this->assertSame(0, $thread->participants()->count()); } /** @test */ @@ -507,7 +507,7 @@ public function it_should_get_all_unread_messages_for_user(): void $secondParticipantUnreadMessages = $thread->userUnreadMessages($participant_2->user_id); $this->assertCount(1, $secondParticipantUnreadMessages); - $this->assertEquals('Message 2', $secondParticipantUnreadMessages->first()->body); + $this->assertSame('Message 2', $secondParticipantUnreadMessages->first()->body); } /** @test */ @@ -544,7 +544,7 @@ public function it_should_get_all_unread_messages_for_user_when_dates_not_set(): $secondParticipantUnreadMessages = $thread->userUnreadMessages($participant_2->user_id); $this->assertCount(1, $secondParticipantUnreadMessages); - $this->assertEquals('Message 2', $secondParticipantUnreadMessages->first()->body); + $this->assertSame('Message 2', $secondParticipantUnreadMessages->first()->body); } /** @test */ @@ -552,7 +552,7 @@ public function it_should_return_empty_collection_when_user_not_participant(): v { $thread = $this->threadFactory(); - $this->assertEquals(0, $thread->userUnreadMessagesCount(1)); + $this->assertSame(0, $thread->userUnreadMessagesCount(1)); } /** @test */ @@ -574,7 +574,7 @@ public function it_should_get_the_creator_of_a_thread(): void $thread->messages()->saveMany([$message_1, $message_2, $message_3]); - $this->assertEquals('Chris Gmyr', $thread->creator()->name); + $this->assertSame('Chris Gmyr', $thread->creator()->name); } /** diff --git a/tests/MessagableTraitTest.php b/tests/MessagableTraitTest.php index 0edd69a..51d4e15 100644 --- a/tests/MessagableTraitTest.php +++ b/tests/MessagableTraitTest.php @@ -29,9 +29,9 @@ public function it_should_get_all_threads_with_new_messages(): void $thread2->messages()->saveMany([$message_1b]); $threads = $user->threadsWithNewMessages(); - $this->assertEquals(1, $threads->first()->id); + $this->assertSame(1, $threads->first()->id); - $this->assertEquals(1, $user->newThreadsCount()); + $this->assertSame(1, $user->newThreadsCount()); } /** @test */ @@ -59,7 +59,7 @@ public function it_get_all_incoming_messages_count_for_user(): void $thread_2->messages()->saveMany([$this->messageFactory(['user_id' => 2])]); - $this->assertEquals(10, $user->unreadMessagesCount()); + $this->assertSame(10, $user->unreadMessagesCount()); } /** @test */ diff --git a/tests/TestCase.php b/tests/TestCase.php index 233b406..10f051e 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -7,13 +7,11 @@ use Cmgmyr\Messenger\Models\Participant; use Cmgmyr\Messenger\Models\Thread; use Illuminate\Database\Eloquent\Model as Eloquent; -use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Orchestra\Testbench\TestCase as OrchestraTestCase; class TestCase extends OrchestraTestCase { - use RefreshDatabase; use WithFaker; protected $loadEnvironmentVariables = true;