From bf42639c36aeb8c40ec6f9562ebc4deb7457f09d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Wed, 14 Dec 2022 23:52:09 +0800 Subject: [PATCH 01/38] Deprecation test improvements --- .github/workflows/deprecations.yml | 112 +++++++++++++++++++++++++++++ composer.json | 4 +- 2 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deprecations.yml diff --git a/.github/workflows/deprecations.yml b/.github/workflows/deprecations.yml new file mode 100644 index 000000000000..aa84d1a149c2 --- /dev/null +++ b/.github/workflows/deprecations.yml @@ -0,0 +1,112 @@ +name: deprecations + +on: + push: + branches: + - master + - '*.x' + pull_request: + +jobs: + linux_tests: + runs-on: ubuntu-22.04 + + services: + memcached: + image: memcached:1.6-alpine + ports: + - 11211:11211 + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: forge + ports: + - 33306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + redis: + image: redis:5.0 + ports: + - 6379:6379 + options: --entrypoint redis-server + dynamodb: + image: amazon/dynamodb-local:latest + ports: + - 8888:8000 + + strategy: + fail-fast: false + matrix: + php: ['8.0', 8.1, 8.2] + stability: [prefer-stable] + experimental: + - true + + name: PHP ${{ matrix.php }} - ${{ matrix.stability }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis-phpredis/phpredis@5.3.7, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp + ini-values: error_reporting=E_ALL + tools: composer:v2 + coverage: none + env: + REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4 + REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev + + - name: Set Minimum PHP 8.0 Versions + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update + if: matrix.php >= 8 + + - name: Set Minimum PHP 8.1 Versions + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 symfony/css-selector:^6.0 --no-interaction --no-update + if: matrix.php >= 8.1 + + - name: Set Minimum PHP 8.2 Versions + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 --no-interaction --no-update + if: matrix.php >= 8.2 + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit --verbose + env: + APP_KEY: "AckfSECXIvnK5r28GVIWUAxmbBSjTsmF" + DB_PORT: ${{ job.services.mysql.ports[3306] }} + DB_USERNAME: root + DYNAMODB_CACHE_TABLE: laravel_dynamodb_test + DYNAMODB_ENDPOINT: "http://localhost:8888" + AWS_ACCESS_KEY_ID: random_key + AWS_SECRET_ACCESS_KEY: random_secret + TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS: true + + - name: Store artifacts + uses: actions/upload-artifact@v2 + with: + name: logs + path: | + vendor/orchestra/testbench-core/laravel/storage/logs + !vendor/**/.gitignore diff --git a/composer.json b/composer.json index 97280b8aa19f..13fd89172d4b 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "egulias/email-validator": "^3.2.1", "fruitcake/php-cors": "^1.2", "laravel/serializable-closure": "^1.2.2", - "league/commonmark": "^2.2", + "league/commonmark": "^2.2.1", "league/flysystem": "^3.8.0", "monolog/monolog": "^2.0", "nesbot/carbon": "^2.62.1", @@ -93,7 +93,7 @@ "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.11", + "orchestra/testbench-core": "^7.16", "pda/pheanstalk": "^4.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^9.5.8", From a8dffab3e30ebf653d83ae7c7522de9bafcaa0ff Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 15 Dec 2022 15:53:42 +0800 Subject: [PATCH 02/38] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 13fd89172d4b..7a0125ed3857 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "egulias/email-validator": "^3.2.1", "fruitcake/php-cors": "^1.2", "laravel/serializable-closure": "^1.2.2", - "league/commonmark": "^2.2.1", + "league/commonmark": "^2.2", "league/flysystem": "^3.8.0", "monolog/monolog": "^2.0", "nesbot/carbon": "^2.62.1", From 7ecb0178ee7ab524452fecfb929d7ebbfc68baa3 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 15 Dec 2022 18:28:19 +0800 Subject: [PATCH 03/38] wip --- .github/workflows/deprecations.yml | 112 ----------------------------- 1 file changed, 112 deletions(-) delete mode 100644 .github/workflows/deprecations.yml diff --git a/.github/workflows/deprecations.yml b/.github/workflows/deprecations.yml deleted file mode 100644 index aa84d1a149c2..000000000000 --- a/.github/workflows/deprecations.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: deprecations - -on: - push: - branches: - - master - - '*.x' - pull_request: - -jobs: - linux_tests: - runs-on: ubuntu-22.04 - - services: - memcached: - image: memcached:1.6-alpine - ports: - - 11211:11211 - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: forge - ports: - - 33306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - redis: - image: redis:5.0 - ports: - - 6379:6379 - options: --entrypoint redis-server - dynamodb: - image: amazon/dynamodb-local:latest - ports: - - 8888:8000 - - strategy: - fail-fast: false - matrix: - php: ['8.0', 8.1, 8.2] - stability: [prefer-stable] - experimental: - - true - - name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis-phpredis/phpredis@5.3.7, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp - ini-values: error_reporting=E_ALL - tools: composer:v2 - coverage: none - env: - REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4 - REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev - - - name: Set Minimum PHP 8.0 Versions - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update - if: matrix.php >= 8 - - - name: Set Minimum PHP 8.1 Versions - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 symfony/css-selector:^6.0 --no-interaction --no-update - if: matrix.php >= 8.1 - - - name: Set Minimum PHP 8.2 Versions - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 --no-interaction --no-update - if: matrix.php >= 8.2 - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit --verbose - env: - APP_KEY: "AckfSECXIvnK5r28GVIWUAxmbBSjTsmF" - DB_PORT: ${{ job.services.mysql.ports[3306] }} - DB_USERNAME: root - DYNAMODB_CACHE_TABLE: laravel_dynamodb_test - DYNAMODB_ENDPOINT: "http://localhost:8888" - AWS_ACCESS_KEY_ID: random_key - AWS_SECRET_ACCESS_KEY: random_secret - TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS: true - - - name: Store artifacts - uses: actions/upload-artifact@v2 - with: - name: logs - path: | - vendor/orchestra/testbench-core/laravel/storage/logs - !vendor/**/.gitignore From aeab885a083ae1d93132baea803dc16e259eeb3e Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 15 Dec 2022 19:06:46 +0800 Subject: [PATCH 04/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b175f145fa2..8a86f1aadad4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -100,6 +100,19 @@ jobs: DYNAMODB_ENDPOINT: "http://localhost:8888" AWS_ACCESS_KEY_ID: random_key AWS_SECRET_ACCESS_KEY: random_secret + if: matrix.stability != 'prefer-lowest' + + - name: Execute tests (without deprecations) + run: vendor/bin/phpunit --verbose + env: + DB_PORT: ${{ job.services.mysql.ports[3306] }} + DB_USERNAME: root + DYNAMODB_CACHE_TABLE: laravel_dynamodb_test + DYNAMODB_ENDPOINT: "http://localhost:8888" + AWS_ACCESS_KEY_ID: random_key + AWS_SECRET_ACCESS_KEY: random_secret + TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS: false + if: matrix.stability == 'prefer-lowest' - name: Store artifacts uses: actions/upload-artifact@v2 @@ -165,6 +178,7 @@ jobs: env: AWS_ACCESS_KEY_ID: random_key AWS_SECRET_ACCESS_KEY: random_secret + TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS: false - name: Store artifacts uses: actions/upload-artifact@v2 From 29eb2eda4f83a7f15127407d55003d2810706e4b Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 15 Dec 2022 19:11:32 +0800 Subject: [PATCH 05/38] wip From 223b34de12e8e73b65a4d33a0bb1cd5127f429c6 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 15 Dec 2022 17:45:56 +0100 Subject: [PATCH 06/38] Update tests.yml --- .github/workflows/tests.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a86f1aadad4..7b175f145fa2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -100,19 +100,6 @@ jobs: DYNAMODB_ENDPOINT: "http://localhost:8888" AWS_ACCESS_KEY_ID: random_key AWS_SECRET_ACCESS_KEY: random_secret - if: matrix.stability != 'prefer-lowest' - - - name: Execute tests (without deprecations) - run: vendor/bin/phpunit --verbose - env: - DB_PORT: ${{ job.services.mysql.ports[3306] }} - DB_USERNAME: root - DYNAMODB_CACHE_TABLE: laravel_dynamodb_test - DYNAMODB_ENDPOINT: "http://localhost:8888" - AWS_ACCESS_KEY_ID: random_key - AWS_SECRET_ACCESS_KEY: random_secret - TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS: false - if: matrix.stability == 'prefer-lowest' - name: Store artifacts uses: actions/upload-artifact@v2 @@ -178,7 +165,6 @@ jobs: env: AWS_ACCESS_KEY_ID: random_key AWS_SECRET_ACCESS_KEY: random_secret - TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS: false - name: Store artifacts uses: actions/upload-artifact@v2 From e0a349a4c2a5aacaf854f13a343ffde126920520 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 15 Dec 2022 17:49:03 +0100 Subject: [PATCH 07/38] Disable tests for now --- .github/workflows/databases.yml | 346 ++++++++++++++++---------------- .github/workflows/tests.yml | 130 ++++++------ 2 files changed, 238 insertions(+), 238 deletions(-) diff --git a/.github/workflows/databases.yml b/.github/workflows/databases.yml index b21686c826dd..9ebb233e176c 100644 --- a/.github/workflows/databases.yml +++ b/.github/workflows/databases.yml @@ -51,176 +51,176 @@ jobs: DB_CONNECTION: mysql DB_USERNAME: root - mysql_8: - runs-on: ubuntu-22.04 - - services: - mysql: - image: mysql:8 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: forge - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - strategy: - fail-fast: true - - name: MySQL 8.0 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql - tools: composer:v2 - coverage: none - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit tests/Integration/Database --verbose - env: - DB_CONNECTION: mysql - DB_USERNAME: root - - mariadb: - runs-on: ubuntu-22.04 - - services: - mysql: - image: mariadb:10 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: forge - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - strategy: - fail-fast: true - - name: MariaDB 10 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql - tools: composer:v2 - coverage: none - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit tests/Integration/Database --verbose - env: - DB_CONNECTION: mysql - DB_USERNAME: root - - pgsql: - runs-on: ubuntu-22.04 - - services: - postgresql: - image: postgres:14 - env: - POSTGRES_DB: forge - POSTGRES_USER: forge - POSTGRES_PASSWORD: password - ports: - - 5432:5432 - options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 - - strategy: - fail-fast: true - - name: PostgreSQL 14 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql - tools: composer:v2 - coverage: none - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit tests/Integration/Database --verbose - env: - DB_CONNECTION: pgsql - DB_PASSWORD: password - - mssql: - runs-on: ubuntu-20.04 - - services: - sqlsrv: - image: mcr.microsoft.com/mssql/server:2019-latest - env: - ACCEPT_EULA: Y - SA_PASSWORD: Forge123 - ports: - - 1433:1433 - - strategy: - fail-fast: true - - name: SQL Server 2019 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc - tools: composer:v2 - coverage: none - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit tests/Integration/Database --verbose - env: - DB_CONNECTION: sqlsrv - DB_DATABASE: master - DB_USERNAME: SA - DB_PASSWORD: Forge123 + # mysql_8: + # runs-on: ubuntu-22.04 + + # services: + # mysql: + # image: mysql:8 + # env: + # MYSQL_ALLOW_EMPTY_PASSWORD: yes + # MYSQL_DATABASE: forge + # ports: + # - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + # strategy: + # fail-fast: true + + # name: MySQL 8.0 + + # steps: + # - name: Checkout code + # uses: actions/checkout@v3 + + # - name: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: 8.1 + # extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql + # tools: composer:v2 + # coverage: none + + # - name: Install dependencies + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 5 + # max_attempts: 5 + # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + # - name: Execute tests + # run: vendor/bin/phpunit tests/Integration/Database --verbose + # env: + # DB_CONNECTION: mysql + # DB_USERNAME: root + + # mariadb: + # runs-on: ubuntu-22.04 + + # services: + # mysql: + # image: mariadb:10 + # env: + # MYSQL_ALLOW_EMPTY_PASSWORD: yes + # MYSQL_DATABASE: forge + # ports: + # - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + # strategy: + # fail-fast: true + + # name: MariaDB 10 + + # steps: + # - name: Checkout code + # uses: actions/checkout@v3 + + # - name: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: 8.1 + # extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql + # tools: composer:v2 + # coverage: none + + # - name: Install dependencies + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 5 + # max_attempts: 5 + # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + # - name: Execute tests + # run: vendor/bin/phpunit tests/Integration/Database --verbose + # env: + # DB_CONNECTION: mysql + # DB_USERNAME: root + + # pgsql: + # runs-on: ubuntu-22.04 + + # services: + # postgresql: + # image: postgres:14 + # env: + # POSTGRES_DB: forge + # POSTGRES_USER: forge + # POSTGRES_PASSWORD: password + # ports: + # - 5432:5432 + # options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 + + # strategy: + # fail-fast: true + + # name: PostgreSQL 14 + + # steps: + # - name: Checkout code + # uses: actions/checkout@v3 + + # - name: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: 8.1 + # extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql + # tools: composer:v2 + # coverage: none + + # - name: Install dependencies + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 5 + # max_attempts: 5 + # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + # - name: Execute tests + # run: vendor/bin/phpunit tests/Integration/Database --verbose + # env: + # DB_CONNECTION: pgsql + # DB_PASSWORD: password + + # mssql: + # runs-on: ubuntu-20.04 + + # services: + # sqlsrv: + # image: mcr.microsoft.com/mssql/server:2019-latest + # env: + # ACCEPT_EULA: Y + # SA_PASSWORD: Forge123 + # ports: + # - 1433:1433 + + # strategy: + # fail-fast: true + + # name: SQL Server 2019 + + # steps: + # - name: Checkout code + # uses: actions/checkout@v3 + + # - name: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: 8.1 + # extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc + # tools: composer:v2 + # coverage: none + + # - name: Install dependencies + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 5 + # max_attempts: 5 + # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + # - name: Execute tests + # run: vendor/bin/phpunit tests/Integration/Database --verbose + # env: + # DB_CONNECTION: sqlsrv + # DB_DATABASE: master + # DB_USERNAME: SA + # DB_PASSWORD: Forge123 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b175f145fa2..23f323858ca4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: true matrix: - php: ['8.0', 8.1, 8.2] + php: [8.2] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} @@ -109,67 +109,67 @@ jobs: vendor/orchestra/testbench-core/laravel/storage/logs !vendor/**/.gitignore - windows_tests: - runs-on: windows-2019 - - strategy: - fail-fast: true - matrix: - php: ['8.0', 8.1, 8.2] - stability: [prefer-lowest, prefer-stable] - - name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows - - steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached, gmp - tools: composer:v2 - coverage: none - - - name: Set Minimum PHP 8.0 Versions - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require guzzlehttp/guzzle:~7.2 --no-interaction --no-update - if: matrix.php >= 8 - - - name: Set Minimum PHP 8.2 Versions - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update - if: matrix.php >= 8.2 - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit --verbose - env: - AWS_ACCESS_KEY_ID: random_key - AWS_SECRET_ACCESS_KEY: random_secret - - - name: Store artifacts - uses: actions/upload-artifact@v2 - with: - name: logs - path: | - vendor/orchestra/testbench-core/laravel/storage/logs - !vendor/**/.gitignore + # windows_tests: + # runs-on: windows-2019 + + # strategy: + # fail-fast: true + # matrix: + # php: ['8.0', 8.1, 8.2] + # stability: [prefer-lowest, prefer-stable] + + # name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows + + # steps: + # - name: Set git to use LF + # run: | + # git config --global core.autocrlf false + # git config --global core.eol lf + + # - name: Checkout code + # uses: actions/checkout@v3 + + # - name: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php }} + # extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached, gmp + # tools: composer:v2 + # coverage: none + + # - name: Set Minimum PHP 8.0 Versions + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 5 + # max_attempts: 5 + # command: composer require guzzlehttp/guzzle:~7.2 --no-interaction --no-update + # if: matrix.php >= 8 + + # - name: Set Minimum PHP 8.2 Versions + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 5 + # max_attempts: 5 + # command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update + # if: matrix.php >= 8.2 + + # - name: Install dependencies + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 5 + # max_attempts: 5 + # command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress + + # - name: Execute tests + # run: vendor/bin/phpunit --verbose + # env: + # AWS_ACCESS_KEY_ID: random_key + # AWS_SECRET_ACCESS_KEY: random_secret + + # - name: Store artifacts + # uses: actions/upload-artifact@v2 + # with: + # name: logs + # path: | + # vendor/orchestra/testbench-core/laravel/storage/logs + # !vendor/**/.gitignore From 18bf2dfd6001128ed77077711938d763040a10e1 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 15 Dec 2022 19:57:33 +0100 Subject: [PATCH 08/38] Fix test --- src/Illuminate/Foundation/Bootstrap/HandleExceptions.php | 6 ++---- tests/Integration/Auth/ForgotPasswordTest.php | 2 ++ .../Auth/ForgotPasswordWithoutDefaultRoutesTest.php | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php index 712576576cfc..a67649b931f8 100644 --- a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php +++ b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php @@ -68,10 +68,8 @@ public function bootstrap(Application $app) public function handleError($level, $message, $file = '', $line = 0, $context = []) { if ($this->isDeprecation($level)) { - return $this->handleDeprecationError($message, $file, $line, $level); - } - - if (error_reporting() & $level) { + $this->handleDeprecationError($message, $file, $line, $level); + } elseif (error_reporting() & $level) { throw new ErrorException($message, 0, $level, $file, $line); } } diff --git a/tests/Integration/Auth/ForgotPasswordTest.php b/tests/Integration/Auth/ForgotPasswordTest.php index 8d7298e90c77..94766105ae78 100644 --- a/tests/Integration/Auth/ForgotPasswordTest.php +++ b/tests/Integration/Auth/ForgotPasswordTest.php @@ -6,6 +6,7 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Password; +use Illuminate\Support\Str; use Illuminate\Tests\Integration\Auth\Fixtures\AuthenticationTestUser; use Orchestra\Testbench\Factories\UserFactory; use Orchestra\Testbench\TestCase; @@ -22,6 +23,7 @@ protected function tearDown(): void protected function defineEnvironment($app) { + $app['config']->set('app.key', Str::random(32)); $app['config']->set('auth.providers.users.model', AuthenticationTestUser::class); } diff --git a/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php b/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php index 787483f027d6..221601ac76f6 100644 --- a/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php +++ b/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php @@ -6,6 +6,7 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Password; +use Illuminate\Support\Str; use Illuminate\Tests\Integration\Auth\Fixtures\AuthenticationTestUser; use Orchestra\Testbench\Factories\UserFactory; use Orchestra\Testbench\TestCase; @@ -22,6 +23,7 @@ protected function tearDown(): void protected function defineEnvironment($app) { + $app['config']->set('app.key', Str::random(32)); $app['config']->set('auth.providers.users.model', AuthenticationTestUser::class); } From 65495177d53a31fd14c01522aeadce1ed3067901 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 07:06:02 +0800 Subject: [PATCH 09/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 23f323858ca4..c51e0a8313a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -81,7 +81,7 @@ jobs: with: timeout_minutes: 5 max_attempts: 5 - command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 --no-interaction --no-update + command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 fakerphp/faker:^1.21 --no-interaction --no-update if: matrix.php >= 8.2 - name: Install dependencies From ee40ce53b006728eeefa80c0b3ab21a4346e9926 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:36:02 +0800 Subject: [PATCH 10/38] wip Signed-off-by: Mior Muhammad Zaki --- tests/Integration/Console/Events/EventListCommandTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Integration/Console/Events/EventListCommandTest.php b/tests/Integration/Console/Events/EventListCommandTest.php index 3273c7da33c1..38c07aeab2c6 100644 --- a/tests/Integration/Console/Events/EventListCommandTest.php +++ b/tests/Integration/Console/Events/EventListCommandTest.php @@ -10,12 +10,16 @@ class EventListCommandTest extends TestCase { + protected $dispatcher; + protected function setUp(): void { parent::setUp(); $this->dispatcher = new Dispatcher(); EventListCommand::resolveEventsUsing(fn () => $this->dispatcher); + + $this->beforeApplicationDestroyed(fn () => unset($this->dispatcher)); } public function testDisplayEmptyList() From 8edd37631b36237a56fc7c0acb17838525b464ec Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:38:52 +0800 Subject: [PATCH 11/38] wip Signed-off-by: Mior Muhammad Zaki --- tests/Integration/Console/Events/EventListCommandTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Integration/Console/Events/EventListCommandTest.php b/tests/Integration/Console/Events/EventListCommandTest.php index 38c07aeab2c6..4fbdda14b707 100644 --- a/tests/Integration/Console/Events/EventListCommandTest.php +++ b/tests/Integration/Console/Events/EventListCommandTest.php @@ -19,7 +19,9 @@ protected function setUp(): void $this->dispatcher = new Dispatcher(); EventListCommand::resolveEventsUsing(fn () => $this->dispatcher); - $this->beforeApplicationDestroyed(fn () => unset($this->dispatcher)); + $this->beforeApplicationDestroyed(function () { + unset($this->dispatcher) + }); } public function testDisplayEmptyList() From d0b84e754a271e45f601d379b50825baa87833c3 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:39:11 +0800 Subject: [PATCH 12/38] wip Signed-off-by: Mior Muhammad Zaki --- tests/Integration/Console/Events/EventListCommandTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/Console/Events/EventListCommandTest.php b/tests/Integration/Console/Events/EventListCommandTest.php index 4fbdda14b707..3ffce93dff4a 100644 --- a/tests/Integration/Console/Events/EventListCommandTest.php +++ b/tests/Integration/Console/Events/EventListCommandTest.php @@ -20,7 +20,7 @@ protected function setUp(): void EventListCommand::resolveEventsUsing(fn () => $this->dispatcher); $this->beforeApplicationDestroyed(function () { - unset($this->dispatcher) + unset($this->dispatcher); }); } From 9db2a814a079bf053ec4522e5666bde3c25b3898 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:41:07 +0800 Subject: [PATCH 13/38] wip Signed-off-by: Mior Muhammad Zaki --- .../Database/DatabaseEloquentModelCustomCastingTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php b/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php index 2cea72d6cd82..9d7ad20ec53a 100644 --- a/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php +++ b/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php @@ -304,6 +304,8 @@ class TestEloquentModelWithCustomCast extends Model class HashCaster implements CastsInboundAttributes { + protected $algorithm; + public function __construct($algorithm = 'sha256') { $this->algorithm = $algorithm; From aaee46e82ee5d4a46eba9118e969361c8c7aca94 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:44:58 +0800 Subject: [PATCH 14/38] wip Signed-off-by: Mior Muhammad Zaki --- .../Database/Eloquent/BroadcastableModelEventOccurred.php | 7 +++++++ .../Console/Scheduling/ScheduleListCommandTest.php | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php b/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php index 14be425afa43..249b18301d8a 100644 --- a/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php +++ b/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php @@ -46,6 +46,13 @@ class BroadcastableModelEventOccurred implements ShouldBroadcast */ public $queue; + /** + * Indicates whether the job should be dispatched after all database transactions have committed. + * + * @var bool|null + */ + public $afterCommit; + /** * Create a new event instance. * diff --git a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php index 2b32a7d5585e..54dccc7730a9 100644 --- a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php +++ b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php @@ -11,6 +11,8 @@ class ScheduleListCommandTest extends TestCase { + protected $schedule; + protected function setUp(): void { parent::setUp(); @@ -19,6 +21,10 @@ protected function setUp(): void ScheduleListCommand::resolveTerminalWidthUsing(fn () => 80); $this->schedule = $this->app->make(Schedule::class); + + $this->beforeApplicationDestroyed(function () { + unset($this->schedule); + }); } public function testDisplayEmptySchedule() From f06a71caf22f9dcf1c71ebad0a2f8ecd2caba226 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:46:06 +0800 Subject: [PATCH 15/38] wip Signed-off-by: Mior Muhammad Zaki --- tests/Integration/Notifications/SendingMailNotificationsTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Integration/Notifications/SendingMailNotificationsTest.php b/tests/Integration/Notifications/SendingMailNotificationsTest.php index 5fe74775f2ef..8a70ef63b3e2 100644 --- a/tests/Integration/Notifications/SendingMailNotificationsTest.php +++ b/tests/Integration/Notifications/SendingMailNotificationsTest.php @@ -21,6 +21,7 @@ class SendingMailNotificationsTest extends TestCase { + public $mailFactory; public $mailer; public $markdown; From 0bb04f5ea2609056e7c5d5bd7e345ae7c684d815 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:48:28 +0800 Subject: [PATCH 16/38] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- tests/Integration/Console/Events/EventListCommandTest.php | 6 +----- .../Console/Scheduling/ScheduleListCommandTest.php | 6 +----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 7a0125ed3857..13fd89172d4b 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "egulias/email-validator": "^3.2.1", "fruitcake/php-cors": "^1.2", "laravel/serializable-closure": "^1.2.2", - "league/commonmark": "^2.2", + "league/commonmark": "^2.2.1", "league/flysystem": "^3.8.0", "monolog/monolog": "^2.0", "nesbot/carbon": "^2.62.1", diff --git a/tests/Integration/Console/Events/EventListCommandTest.php b/tests/Integration/Console/Events/EventListCommandTest.php index 3ffce93dff4a..200f8df3c80b 100644 --- a/tests/Integration/Console/Events/EventListCommandTest.php +++ b/tests/Integration/Console/Events/EventListCommandTest.php @@ -10,7 +10,7 @@ class EventListCommandTest extends TestCase { - protected $dispatcher; + public $dispatcher; protected function setUp(): void { @@ -18,10 +18,6 @@ protected function setUp(): void $this->dispatcher = new Dispatcher(); EventListCommand::resolveEventsUsing(fn () => $this->dispatcher); - - $this->beforeApplicationDestroyed(function () { - unset($this->dispatcher); - }); } public function testDisplayEmptyList() diff --git a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php index 54dccc7730a9..4c0d6bcee70f 100644 --- a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php +++ b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php @@ -11,7 +11,7 @@ class ScheduleListCommandTest extends TestCase { - protected $schedule; + public $schedule; protected function setUp(): void { @@ -21,10 +21,6 @@ protected function setUp(): void ScheduleListCommand::resolveTerminalWidthUsing(fn () => 80); $this->schedule = $this->app->make(Schedule::class); - - $this->beforeApplicationDestroyed(function () { - unset($this->schedule); - }); } public function testDisplayEmptySchedule() From 67e9ae21587d6f335fda5c1720ef122142ee4a8d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:49:57 +0800 Subject: [PATCH 17/38] wip Signed-off-by: Mior Muhammad Zaki --- tests/Integration/Routing/UrlSigningTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Integration/Routing/UrlSigningTest.php b/tests/Integration/Routing/UrlSigningTest.php index 7c9c69deff84..a19eb44b802a 100644 --- a/tests/Integration/Routing/UrlSigningTest.php +++ b/tests/Integration/Routing/UrlSigningTest.php @@ -286,6 +286,7 @@ public function __construct(array $ignore) class RoutableInterfaceStub implements UrlRoutable { public $key; + public $routable; public $slug = 'routable-slug'; public function getRouteKey() From 3d0a089f80584c0f113ee9949ffa8d83bf338d08 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:51:41 +0800 Subject: [PATCH 18/38] wip Signed-off-by: Mior Muhammad Zaki --- tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php index 014b7e16f276..c533bce0bbae 100644 --- a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php +++ b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php @@ -129,6 +129,8 @@ class CircuitBreakerWithRedisTestJob public static $handled = false; + public $key; + public function __construct($key) { $this->key = $key; From ada95e5091e4a7729dac5991e1c8b64c927cc1c4 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 08:57:48 +0800 Subject: [PATCH 19/38] wip Signed-off-by: Mior Muhammad Zaki --- .../Integration/Console/Scheduling/ScheduleTestCommandTest.php | 2 ++ tests/Integration/Database/EloquentHasOneOfManyTest.php | 2 ++ tests/Integration/Migration/MigratorTest.php | 2 ++ tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php b/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php index 66e81e74883d..cde9883d8242 100644 --- a/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php +++ b/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php @@ -11,6 +11,8 @@ class ScheduleTestCommandTest extends TestCase { + public $schedule; + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Database/EloquentHasOneOfManyTest.php b/tests/Integration/Database/EloquentHasOneOfManyTest.php index fc1edfbf8b75..2f0b774ce401 100644 --- a/tests/Integration/Database/EloquentHasOneOfManyTest.php +++ b/tests/Integration/Database/EloquentHasOneOfManyTest.php @@ -8,6 +8,8 @@ class EloquentHasOneOfManyTest extends DatabaseTestCase { + public $retrievedLogins; + protected function defineDatabaseMigrationsAfterDatabaseRefreshed() { Schema::create('users', function ($table) { diff --git a/tests/Integration/Migration/MigratorTest.php b/tests/Integration/Migration/MigratorTest.php index 5e364b113c72..28ae835e8a95 100644 --- a/tests/Integration/Migration/MigratorTest.php +++ b/tests/Integration/Migration/MigratorTest.php @@ -14,6 +14,8 @@ class MigratorTest extends TestCase */ private $output; + public $subject; + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php index c533bce0bbae..87a7af68a22c 100644 --- a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php +++ b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php @@ -155,6 +155,8 @@ class CircuitBreakerWithRedisSuccessfulJob public static $handled = false; + public $key; + public function __construct($key) { $this->key = $key; From 51f503a3153274099f19e1362686bda5b135fe53 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 09:04:18 +0800 Subject: [PATCH 20/38] wip Signed-off-by: Mior Muhammad Zaki --- .../Http/Resources/Json/AnonymousResourceCollection.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php b/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php index a583136490a6..d262d2665738 100644 --- a/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php +++ b/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php @@ -2,6 +2,7 @@ namespace Illuminate\Http\Resources\Json; +#[\AllowDynamicProperties] class AnonymousResourceCollection extends ResourceCollection { /** From 73ea9acc88c1811ffd64bf9037e48e904e4b0dac Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 09:08:22 +0800 Subject: [PATCH 21/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c51e0a8313a8..db0300101792 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,7 +37,7 @@ jobs: - 8888:8000 strategy: - fail-fast: true + fail-fast: false matrix: php: [8.2] stability: [prefer-lowest, prefer-stable] From 53b84a1e7c95202b5beba219fccf15982b17faa2 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 09:11:15 +0800 Subject: [PATCH 22/38] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Console/Scheduling/ScheduleListCommand.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index 155095874cd1..5f505bab96fd 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -80,17 +80,20 @@ public function handle(Schedule $schedule) $events = $events->map(function ($event) use ($terminalWidth, $expressionSpacing, $timezone) { $expression = $this->formatCronExpression($event->expression, $expressionSpacing); + /** @var string|null $command */ $command = $event->command; + + /** @var string|null $description */ $description = $event->description; - if (! $this->output->isVerbose()) { + if (! $this->output->isVerbose() && is_string($event->command)) { $command = str_replace([Application::phpBinary(), Application::artisanBinary()], [ 'php', preg_replace("#['\"]#", '', Application::artisanBinary()), ], $event->command); } - if ($event instanceof CallbackEvent) { + if ($event instanceof CallbackEvent && is_string($event->description)) { if (class_exists($event->description)) { $command = $event->description; $description = ''; From 1edd0342b817d38b2982b975cde27e2fbd79ad46 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 09:16:47 +0800 Subject: [PATCH 23/38] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Console/Scheduling/ScheduleListCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index 5f505bab96fd..fed14e5e0586 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -102,7 +102,7 @@ public function handle(Schedule $schedule) } } - $command = mb_strlen($command) > 1 ? "{$command} " : ''; + $command = is_string($command) && mb_strlen($command) > 1 ? "{$command} " : ''; $nextDueDateLabel = 'Next Due:'; From 72f5fe717c07dc9e6cf6a820a78e859eeca8b059 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 09:18:20 +0800 Subject: [PATCH 24/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db0300101792..c7dc8aad94e9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -81,7 +81,7 @@ jobs: with: timeout_minutes: 5 max_attempts: 5 - command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 fakerphp/faker:^1.21 --no-interaction --no-update + command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 symfony/css-selector:^6.0 predis/predis:^2.0.2 fakerphp/faker:^1.21 --no-interaction --no-update if: matrix.php >= 8.2 - name: Install dependencies From 1ab2ba85c3141cf1a2caa604985b35f610c6b6e4 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 09:27:15 +0800 Subject: [PATCH 25/38] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Console/Scheduling/CallbackEvent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/CallbackEvent.php b/src/Illuminate/Console/Scheduling/CallbackEvent.php index e91600ac3a40..08b4da569faf 100644 --- a/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -184,7 +184,7 @@ public function getSummaryForDisplay() */ public function mutexName() { - return 'framework/schedule-'.sha1($this->description); + return 'framework/schedule-'.sha1($this->getSummaryForDisplay()); } /** From 5189e3650490dda666c02c73a9bc8ddf8c935811 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 09:32:37 +0800 Subject: [PATCH 26/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c7dc8aad94e9..08e58a2c1e55 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.2] + php: [8.1, 8.2] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} From c74b65a6ddebcfba2cdda31ad0ac74dd87fe77d0 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 10:10:20 +0800 Subject: [PATCH 27/38] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Console/Scheduling/CallbackEvent.php | 2 +- src/Illuminate/Console/Scheduling/ScheduleListCommand.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/CallbackEvent.php b/src/Illuminate/Console/Scheduling/CallbackEvent.php index 08b4da569faf..e91600ac3a40 100644 --- a/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -184,7 +184,7 @@ public function getSummaryForDisplay() */ public function mutexName() { - return 'framework/schedule-'.sha1($this->getSummaryForDisplay()); + return 'framework/schedule-'.sha1($this->description); } /** diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index fed14e5e0586..ccf8715e6a10 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -93,8 +93,8 @@ public function handle(Schedule $schedule) ], $event->command); } - if ($event instanceof CallbackEvent && is_string($event->description)) { - if (class_exists($event->description)) { + if ($event instanceof CallbackEvent) { + if (is_string($event->description) && class_exists($event->description)) { $command = $event->description; $description = ''; } else { @@ -112,7 +112,7 @@ public function handle(Schedule $schedule) ? $nextDueDate->format('Y-m-d H:i:s P') : $nextDueDate->diffForHumans(); - $hasMutex = $event->mutex->exists($event) ? 'Has Mutex › ' : ''; + $hasMutex = is_string($event->description) && $event->mutex->exists($event) ? 'Has Mutex › ' : ''; $dots = str_repeat('.', max( $terminalWidth - mb_strlen($expression.$command.$nextDueDateLabel.$nextDueDate.$hasMutex) - 8, 0 From f5d18d5c7a391455e60e56e027aaa6bd4b773609 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 10:14:17 +0800 Subject: [PATCH 28/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 08e58a2c1e55..41d07ed6e1bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,7 +73,7 @@ jobs: with: timeout_minutes: 5 max_attempts: 5 - command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update + command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 symfony/css-selector:^6.0 --no-interaction --no-update if: matrix.php >= 8.1 - name: Set Minimum PHP 8.2 Versions @@ -81,7 +81,7 @@ jobs: with: timeout_minutes: 5 max_attempts: 5 - command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 symfony/css-selector:^6.0 predis/predis:^2.0.2 fakerphp/faker:^1.21 --no-interaction --no-update + command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 fakerphp/faker:^1.21 --no-interaction --no-update if: matrix.php >= 8.2 - name: Install dependencies From 9222fc86f9f160f01fea7517b3a8b8bcbac2dacc Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 10:19:28 +0800 Subject: [PATCH 29/38] wip Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Console/Scheduling/ScheduleListCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index ccf8715e6a10..f6fb1c1f972b 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -112,7 +112,9 @@ public function handle(Schedule $schedule) ? $nextDueDate->format('Y-m-d H:i:s P') : $nextDueDate->diffForHumans(); - $hasMutex = is_string($event->description) && $event->mutex->exists($event) ? 'Has Mutex › ' : ''; + $hasMutex = $event instanceof CallbackEvent + ? (is_string($event->description) && $event->mutex->exists($event) ? 'Has Mutex › ' : '') + : ($event->mutex->exists($event) ? 'Has Mutex › ' : ''); $dots = str_repeat('.', max( $terminalWidth - mb_strlen($expression.$command.$nextDueDateLabel.$nextDueDate.$hasMutex) - 8, 0 From fd3754a4ee266773377787ff23edf2ffe2d2ef0d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 10:25:12 +0800 Subject: [PATCH 30/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 41d07ed6e1bd..92be1d4073ff 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,9 +37,9 @@ jobs: - 8888:8000 strategy: - fail-fast: false + fail-fast: true matrix: - php: [8.1, 8.2] + php: ['8.0', 8.1, 8.2] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} From b3f649ba3bff36f3874007f7197167d2fe0d70c5 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 10:28:07 +0800 Subject: [PATCH 31/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/databases.yml | 346 ++++++++++++++++---------------- 1 file changed, 173 insertions(+), 173 deletions(-) diff --git a/.github/workflows/databases.yml b/.github/workflows/databases.yml index 9ebb233e176c..b21686c826dd 100644 --- a/.github/workflows/databases.yml +++ b/.github/workflows/databases.yml @@ -51,176 +51,176 @@ jobs: DB_CONNECTION: mysql DB_USERNAME: root - # mysql_8: - # runs-on: ubuntu-22.04 - - # services: - # mysql: - # image: mysql:8 - # env: - # MYSQL_ALLOW_EMPTY_PASSWORD: yes - # MYSQL_DATABASE: forge - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - # strategy: - # fail-fast: true - - # name: MySQL 8.0 - - # steps: - # - name: Checkout code - # uses: actions/checkout@v3 - - # - name: Setup PHP - # uses: shivammathur/setup-php@v2 - # with: - # php-version: 8.1 - # extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql - # tools: composer:v2 - # coverage: none - - # - name: Install dependencies - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 5 - # max_attempts: 5 - # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - # - name: Execute tests - # run: vendor/bin/phpunit tests/Integration/Database --verbose - # env: - # DB_CONNECTION: mysql - # DB_USERNAME: root - - # mariadb: - # runs-on: ubuntu-22.04 - - # services: - # mysql: - # image: mariadb:10 - # env: - # MYSQL_ALLOW_EMPTY_PASSWORD: yes - # MYSQL_DATABASE: forge - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - # strategy: - # fail-fast: true - - # name: MariaDB 10 - - # steps: - # - name: Checkout code - # uses: actions/checkout@v3 - - # - name: Setup PHP - # uses: shivammathur/setup-php@v2 - # with: - # php-version: 8.1 - # extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql - # tools: composer:v2 - # coverage: none - - # - name: Install dependencies - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 5 - # max_attempts: 5 - # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - # - name: Execute tests - # run: vendor/bin/phpunit tests/Integration/Database --verbose - # env: - # DB_CONNECTION: mysql - # DB_USERNAME: root - - # pgsql: - # runs-on: ubuntu-22.04 - - # services: - # postgresql: - # image: postgres:14 - # env: - # POSTGRES_DB: forge - # POSTGRES_USER: forge - # POSTGRES_PASSWORD: password - # ports: - # - 5432:5432 - # options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 - - # strategy: - # fail-fast: true - - # name: PostgreSQL 14 - - # steps: - # - name: Checkout code - # uses: actions/checkout@v3 - - # - name: Setup PHP - # uses: shivammathur/setup-php@v2 - # with: - # php-version: 8.1 - # extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql - # tools: composer:v2 - # coverage: none - - # - name: Install dependencies - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 5 - # max_attempts: 5 - # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - # - name: Execute tests - # run: vendor/bin/phpunit tests/Integration/Database --verbose - # env: - # DB_CONNECTION: pgsql - # DB_PASSWORD: password - - # mssql: - # runs-on: ubuntu-20.04 - - # services: - # sqlsrv: - # image: mcr.microsoft.com/mssql/server:2019-latest - # env: - # ACCEPT_EULA: Y - # SA_PASSWORD: Forge123 - # ports: - # - 1433:1433 - - # strategy: - # fail-fast: true - - # name: SQL Server 2019 - - # steps: - # - name: Checkout code - # uses: actions/checkout@v3 - - # - name: Setup PHP - # uses: shivammathur/setup-php@v2 - # with: - # php-version: 8.1 - # extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc - # tools: composer:v2 - # coverage: none - - # - name: Install dependencies - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 5 - # max_attempts: 5 - # command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - # - name: Execute tests - # run: vendor/bin/phpunit tests/Integration/Database --verbose - # env: - # DB_CONNECTION: sqlsrv - # DB_DATABASE: master - # DB_USERNAME: SA - # DB_PASSWORD: Forge123 + mysql_8: + runs-on: ubuntu-22.04 + + services: + mysql: + image: mysql:8 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: forge + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: true + + name: MySQL 8.0 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql + tools: composer:v2 + coverage: none + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit tests/Integration/Database --verbose + env: + DB_CONNECTION: mysql + DB_USERNAME: root + + mariadb: + runs-on: ubuntu-22.04 + + services: + mysql: + image: mariadb:10 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: forge + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: true + + name: MariaDB 10 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql + tools: composer:v2 + coverage: none + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit tests/Integration/Database --verbose + env: + DB_CONNECTION: mysql + DB_USERNAME: root + + pgsql: + runs-on: ubuntu-22.04 + + services: + postgresql: + image: postgres:14 + env: + POSTGRES_DB: forge + POSTGRES_USER: forge + POSTGRES_PASSWORD: password + ports: + - 5432:5432 + options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: true + + name: PostgreSQL 14 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql + tools: composer:v2 + coverage: none + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit tests/Integration/Database --verbose + env: + DB_CONNECTION: pgsql + DB_PASSWORD: password + + mssql: + runs-on: ubuntu-20.04 + + services: + sqlsrv: + image: mcr.microsoft.com/mssql/server:2019-latest + env: + ACCEPT_EULA: Y + SA_PASSWORD: Forge123 + ports: + - 1433:1433 + + strategy: + fail-fast: true + + name: SQL Server 2019 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc + tools: composer:v2 + coverage: none + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit tests/Integration/Database --verbose + env: + DB_CONNECTION: sqlsrv + DB_DATABASE: master + DB_USERNAME: SA + DB_PASSWORD: Forge123 From d80ed863e11fbf2d8fa39fb0b0996f50137a3be1 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 10:39:28 +0800 Subject: [PATCH 32/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 128 ++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 92be1d4073ff..aeb1420dffc4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -109,67 +109,67 @@ jobs: vendor/orchestra/testbench-core/laravel/storage/logs !vendor/**/.gitignore - # windows_tests: - # runs-on: windows-2019 - - # strategy: - # fail-fast: true - # matrix: - # php: ['8.0', 8.1, 8.2] - # stability: [prefer-lowest, prefer-stable] - - # name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows - - # steps: - # - name: Set git to use LF - # run: | - # git config --global core.autocrlf false - # git config --global core.eol lf - - # - name: Checkout code - # uses: actions/checkout@v3 - - # - name: Setup PHP - # uses: shivammathur/setup-php@v2 - # with: - # php-version: ${{ matrix.php }} - # extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached, gmp - # tools: composer:v2 - # coverage: none - - # - name: Set Minimum PHP 8.0 Versions - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 5 - # max_attempts: 5 - # command: composer require guzzlehttp/guzzle:~7.2 --no-interaction --no-update - # if: matrix.php >= 8 - - # - name: Set Minimum PHP 8.2 Versions - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 5 - # max_attempts: 5 - # command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update - # if: matrix.php >= 8.2 - - # - name: Install dependencies - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 5 - # max_attempts: 5 - # command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress - - # - name: Execute tests - # run: vendor/bin/phpunit --verbose - # env: - # AWS_ACCESS_KEY_ID: random_key - # AWS_SECRET_ACCESS_KEY: random_secret - - # - name: Store artifacts - # uses: actions/upload-artifact@v2 - # with: - # name: logs - # path: | - # vendor/orchestra/testbench-core/laravel/storage/logs - # !vendor/**/.gitignore + windows_tests: + runs-on: windows-2019 + + strategy: + fail-fast: true + matrix: + php: ['8.0', 8.1, 8.2] + stability: [prefer-lowest, prefer-stable] + + name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows + + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached, gmp + tools: composer:v2 + coverage: none + + - name: Set Minimum PHP 8.0 Versions + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require guzzlehttp/guzzle:~7.2 --no-interaction --no-update + if: matrix.php >= 8 + + - name: Set Minimum PHP 8.2 Versions + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update + if: matrix.php >= 8.2 + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit --verbose + env: + AWS_ACCESS_KEY_ID: random_key + AWS_SECRET_ACCESS_KEY: random_secret + + - name: Store artifacts + uses: actions/upload-artifact@v2 + with: + name: logs + path: | + vendor/orchestra/testbench-core/laravel/storage/logs + !vendor/**/.gitignore From b9c31fab55c9782c3475599c7044440f0cbf8398 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 10:46:11 +0800 Subject: [PATCH 33/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aeb1420dffc4..9034d37f3f47 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -145,12 +145,20 @@ jobs: command: composer require guzzlehttp/guzzle:~7.2 --no-interaction --no-update if: matrix.php >= 8 + - name: Set Minimum PHP 8.1 Versions + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require ramsey/collection:~1.2 brick/math:~0.9.3 symfony/css-selector:~6.0 --no-interaction --no-update + if: matrix.php >= 8.1 + - name: Set Minimum PHP 8.2 Versions uses: nick-fields/retry@v2 with: timeout_minutes: 5 max_attempts: 5 - command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update + command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:~2.0.2 --no-interaction --no-update if: matrix.php >= 8.2 - name: Install dependencies From ab71d61134a540a2668dd4c0cb48a77e3c7fcf5b Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 11:01:04 +0800 Subject: [PATCH 34/38] wip From 13651ebdd8831b8f8256e4f2471d9a4174e7183f Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 16 Dec 2022 11:30:27 +0800 Subject: [PATCH 35/38] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9034d37f3f47..25d3a62e4e51 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -81,7 +81,7 @@ jobs: with: timeout_minutes: 5 max_attempts: 5 - command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 fakerphp/faker:^1.21 --no-interaction --no-update + command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 --no-interaction --no-update if: matrix.php >= 8.2 - name: Install dependencies diff --git a/composer.json b/composer.json index 13fd89172d4b..dd775c9576de 100644 --- a/composer.json +++ b/composer.json @@ -85,7 +85,7 @@ "ably/ably-php": "^1.0", "aws/aws-sdk-php": "^3.235.5", "doctrine/dbal": "^2.13.3|^3.1.4", - "fakerphp/faker": "^1.9.2", + "fakerphp/faker": "^1.21", "guzzlehttp/guzzle": "^7.5", "league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-ftp": "^3.0", From 32923261bce0ad70f94f009b23a8baa85b05ded5 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Fri, 16 Dec 2022 10:53:51 +0100 Subject: [PATCH 36/38] Refactor --- src/Illuminate/Console/Command.php | 2 +- src/Illuminate/Console/Scheduling/Event.php | 6 +++--- .../Scheduling/ScheduleListCommand.php | 20 +++++++++---------- src/Illuminate/Database/composer.json | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/Illuminate/Console/Command.php b/src/Illuminate/Console/Command.php index 675622059d6a..8b4001cb8f52 100755 --- a/src/Illuminate/Console/Command.php +++ b/src/Illuminate/Console/Command.php @@ -42,7 +42,7 @@ class Command extends SymfonyCommand /** * The console command description. * - * @var string + * @var string|null */ protected $description; diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index a132ad3c63da..36c180b95a30 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -26,7 +26,7 @@ class Event /** * The command string. * - * @var string + * @var string|null */ public $command; @@ -47,7 +47,7 @@ class Event /** * The user the command should run as. * - * @var string + * @var string|null */ public $user; @@ -138,7 +138,7 @@ class Event /** * The human readable description of the event. * - * @var string + * @var string|null */ public $description; diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index f6fb1c1f972b..6bb6e134235f 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -80,29 +80,27 @@ public function handle(Schedule $schedule) $events = $events->map(function ($event) use ($terminalWidth, $expressionSpacing, $timezone) { $expression = $this->formatCronExpression($event->expression, $expressionSpacing); - /** @var string|null $command */ - $command = $event->command; + $command = $event->command ?? ''; - /** @var string|null $description */ - $description = $event->description; + $description = $event->description ?? ''; - if (! $this->output->isVerbose() && is_string($event->command)) { + if (! $this->output->isVerbose()) { $command = str_replace([Application::phpBinary(), Application::artisanBinary()], [ 'php', preg_replace("#['\"]#", '', Application::artisanBinary()), - ], $event->command); + ], $command); } if ($event instanceof CallbackEvent) { - if (is_string($event->description) && class_exists($event->description)) { - $command = $event->description; + if (class_exists($description)) { + $command = $description; $description = ''; } else { $command = 'Closure at: '.$this->getClosureLocation($event); } } - $command = is_string($command) && mb_strlen($command) > 1 ? "{$command} " : ''; + $command = mb_strlen($command) > 1 ? "{$command} " : ''; $nextDueDateLabel = 'Next Due:'; @@ -113,7 +111,7 @@ public function handle(Schedule $schedule) : $nextDueDate->diffForHumans(); $hasMutex = $event instanceof CallbackEvent - ? (is_string($event->description) && $event->mutex->exists($event) ? 'Has Mutex › ' : '') + ? (isset($event->description) && $event->mutex->exists($event) ? 'Has Mutex › ' : '') : ($event->mutex->exists($event) ? 'Has Mutex › ' : ''); $dots = str_repeat('.', max( @@ -154,7 +152,7 @@ private function getCronExpressionSpacing($events) { $rows = $events->map(fn ($event) => array_map('mb_strlen', preg_split("/\s+/", $event->expression))); - return collect($rows[0] ?? [])->keys()->map(fn ($key) => $rows->max($key)); + return collect($rows[0] ?? [])->keys()->map(fn ($key) => $rows->max($key))->all(); } /** diff --git a/src/Illuminate/Database/composer.json b/src/Illuminate/Database/composer.json index 912ac9f484c4..4a94f707dddc 100644 --- a/src/Illuminate/Database/composer.json +++ b/src/Illuminate/Database/composer.json @@ -36,7 +36,7 @@ }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.21).", "illuminate/console": "Required to use the database commands (^9.0).", "illuminate/events": "Required to use the observers with Eloquent (^9.0).", "illuminate/filesystem": "Required to use the migrations (^9.0).", From f41185bd5dc6cdf684461ebd256ac6d186cc5e56 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Fri, 16 Dec 2022 11:01:39 +0100 Subject: [PATCH 37/38] Refactor --- .../Http/Resources/Json/AnonymousResourceCollection.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php b/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php index d262d2665738..26f5c460ce63 100644 --- a/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php +++ b/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php @@ -2,7 +2,6 @@ namespace Illuminate\Http\Resources\Json; -#[\AllowDynamicProperties] class AnonymousResourceCollection extends ResourceCollection { /** @@ -12,6 +11,13 @@ class AnonymousResourceCollection extends ResourceCollection */ public $collects; + /** + * Indicates if the collection keys should be preserved. + * + * @var bool + */ + public $preserveKeys = false; + /** * Create a new anonymous resource collection. * From 0161653afc85618085a90f3e2872c092cbec1990 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Fri, 16 Dec 2022 11:09:13 +0100 Subject: [PATCH 38/38] Refactor --- src/Illuminate/Console/Scheduling/CallbackEvent.php | 2 +- src/Illuminate/Console/Scheduling/ScheduleListCommand.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/CallbackEvent.php b/src/Illuminate/Console/Scheduling/CallbackEvent.php index e91600ac3a40..db5e0297072a 100644 --- a/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -184,7 +184,7 @@ public function getSummaryForDisplay() */ public function mutexName() { - return 'framework/schedule-'.sha1($this->description); + return 'framework/schedule-'.sha1($this->description ?? ''); } /** diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index 6bb6e134235f..607f5a5617aa 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -110,9 +110,7 @@ public function handle(Schedule $schedule) ? $nextDueDate->format('Y-m-d H:i:s P') : $nextDueDate->diffForHumans(); - $hasMutex = $event instanceof CallbackEvent - ? (isset($event->description) && $event->mutex->exists($event) ? 'Has Mutex › ' : '') - : ($event->mutex->exists($event) ? 'Has Mutex › ' : ''); + $hasMutex = $event->mutex->exists($event) ? 'Has Mutex › ' : ''; $dots = str_repeat('.', max( $terminalWidth - mb_strlen($expression.$command.$nextDueDateLabel.$nextDueDate.$hasMutex) - 8, 0