Skip to content

Commit

Permalink
Tests with pest (#33)
Browse files Browse the repository at this point in the history
* installed and configured pest

* updated github test workflow

* setup test database, migrations and seeders

* improved `ConversationSeeder`

* added more util message apis to `Conversation` model
- `replyMessage`
- `createMessage`

* suspended run-test action prefer-lowest

* WIP: conversation Unit

* added whereType to `notMsgEvents` query
- fixed `otherParticipants` return type

* WIP: conversation util method tests

* added conversation broadcast assertions

* added conversation collection assertions

* proper conversation collection assertion

* added conversation query tests

* improved `whereNotPaticipant` query

* changed `notMsgEvents` to `whereDoesntHaveChatEvents`

* changed conversation's `notMsgEvents` to `doesntHaveChatEvents`

* added `whereNotReadBy``whereNotDeliveredTo` `whereNotDeletedBy` query methods

* formatting

* added messege units tests

* removed prepend system message method

* fixed conversation reply message

* added message relationship tests

* renamed `withTrashed` to `withAll`

* fixed `notMessenger` typo

* improved `notMessenger` query

* added chatEvent unit tests

* added `conversationUser` unit tests

* added Event Feature Tests

* added Job Tests

* fixed conversation uodate

* enabled test app debug

* added conversation controller feature tests

* added message controller feature tests

* removed basic test

* added more helpers to pest test

* added chat event controller feature tests

* fixed incosistent message test

* formatting
  • Loading branch information
myckhel authored Oct 17, 2021
1 parent 733170a commit 39552fc
Show file tree
Hide file tree
Showing 17 changed files with 1,843 additions and 99 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/laravel.yml → .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: "Run Tests - Current"
name: run-tests

on: [push, pull_request]
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.0]
laravel: [8.*]
dependency-version: [prefer-lowest, prefer-stable]
dependency-version: [prefer-stable]
# dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
Expand Down Expand Up @@ -40,4 +44,4 @@ jobs:
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
run: composer test
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@
"require": {
"php": "^8.0",
"illuminate/support": "~7|~8",
"nesbot/carbon": "^2.36.0"
"nesbot/carbon": "^2.50"
},
"scripts": {
"test": "vendor/bin/phpunit",
"post-autoload-dump": [
"@php vendor/bin/testbench package:discover --ansi"
]
"test": "./vendor/bin/pest"
},
"require-dev": {
"php": "^8",
"fakerphp/faker": "^1.12",
"phpunit/phpunit": "~9.0",
"orchestra/testbench": "~5|~6"
"orchestra/testbench": "~5|~6",
"pestphp/pest": "^1.11",
"spatie/pest-plugin-test-time": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 39552fc

Please sign in to comment.