Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ permissions:
contents: read

on:
schedule:
- cron: '0 4 * * *' # daily 04:00 UTC canary keepalive
pull_request:
branches:
- "*"
push:
branches:
- 'master'
workflow_dispatch: {}

env:
COLUMNS: 120
Expand All @@ -34,12 +37,12 @@ jobs:
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
strategy:
matrix:
php-version: [ 8.2, 8.3, 8.4 ]
php-version: [ 8.3, 8.4, 8.5 ]
coverage: [ xdebug, none ]
composer_flags: [ "--prefer-lowest", "" ]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
fetch-depth: 0

Expand Down Expand Up @@ -71,22 +74,23 @@ jobs:
run: make report-coveralls --no-print-directory || true

- name: Upload Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
path: build/
overwrite: true


linters:
name: Linters
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.2, 8.3, 8.4 ]
php-version: [ 8.3, 8.4, 8.5 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
fetch-depth: 0

Expand All @@ -105,22 +109,23 @@ jobs:
run: make codestyle --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: Linters - ${{ matrix.php-version }}
path: build/
overwrite: true


report:
name: Reports
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.2, 8.3, 8.4 ]
php-version: [ 8.3, 8.4, 8.5 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
fetch-depth: 0

Expand All @@ -139,8 +144,9 @@ jobs:
run: make report-all --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: Reports - ${{ matrix.php-version }}
path: build/
overwrite: true
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ class MyFeatureTest extends PHPUnit

## Dependencies

- PHP 8.2+ required
- PHP 8.3+ required
- PHPUnit ^9.6.29 as core testing framework
- JBZoo toolbox ecosystem (codestyle, markdown, etc.)
- Development dependencies managed via jbzoo/toolbox-dev

## CI/CD

GitHub Actions workflow runs:
- PHPUnit tests across PHP 8.1, 8.2, 8.3
- PHPUnit tests across PHP 8.3, 8.4, 8.5
- Code quality checks (linters)
- Coverage reporting to Coveralls
- Matrix testing with different Composer flags (--prefer-lowest)
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# JBZoo / PHPUnit

[![CI](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/PHPUnit/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/PHPUnit?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/PHPUnit/coverage.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) [![Psalm Level](https://shepherd.dev/github/JBZoo/PHPUnit/level.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/phpunit/badge)](https://www.codefactor.io/repository/github/jbzoo/phpunit/issues)
[![Stable Version](https://poser.pugx.org/jbzoo/phpunit/version)](https://packagist.org/packages/jbzoo/phpunit/) [![Total Downloads](https://poser.pugx.org/jbzoo/phpunit/downloads)](https://packagist.org/packages/jbzoo/phpunit/stats) [![Dependents](https://poser.pugx.org/jbzoo/phpunit/dependents)](https://packagist.org/packages/jbzoo/phpunit/dependents?order_by=downloads) [![GitHub License](https://img.shields.io/github/license/jbzoo/phpunit)](https://github.com/JBZoo/PHPUnit/blob/master/LICENSE)
[![CI](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/JBZoo/PHPUnit/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/PHPUnit?branch=master)
[![Psalm Coverage](https://shepherd.dev/github/JBZoo/PHPUnit/coverage.svg)](https://shepherd.dev/github/JBZoo/PHPUnit)
[![Psalm Level](https://shepherd.dev/github/JBZoo/PHPUnit/level.svg)](https://shepherd.dev/github/JBZoo/PHPUnit)
[![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/phpunit/badge)](https://www.codefactor.io/repository/github/jbzoo/phpunit/issues)

[![Stable Version](https://poser.pugx.org/jbzoo/phpunit/version)](https://packagist.org/packages/jbzoo/phpunit/)
[![Total Downloads](https://poser.pugx.org/jbzoo/phpunit/downloads)](https://packagist.org/packages/jbzoo/phpunit/stats)
[![Dependents](https://poser.pugx.org/jbzoo/phpunit/dependents)](https://packagist.org/packages/jbzoo/phpunit/dependents?order_by=downloads)
[![GitHub License](https://img.shields.io/github/license/jbzoo/phpunit)](https://github.com/JBZoo/PHPUnit/blob/master/LICENSE)

PHPUnit toolbox with short assertion aliases and useful testing utilities. This library provides a more concise and readable way to write tests by offering shorter function names for common PHPUnit assertions.

Expand All @@ -11,7 +19,7 @@ PHPUnit toolbox with short assertion aliases and useful testing utilities. This
- **Extended assertions** - Additional assertions for emails, dates, amounts, file contents
- **Environment detection** - Detect if running under TeamCity, Travis, PhpStorm
- **Built-in utilities** - Tools for test organization and debugging
- **PHP 8.2+ support** - Modern PHP features and strict typing
- **PHP 8.3+ support** - Modern PHP features and strict typing

## Installation

Expand Down Expand Up @@ -152,7 +160,7 @@ class PackageTest extends PHPUnit

## Requirements

- PHP 8.2 or higher
- PHP 8.3 or higher
- PHPUnit ^9.6.29
- ext-filter, ext-mbstring

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
"prefer-stable" : true,

"require" : {
"php" : "^8.2",
"php" : "^8.3",
"ext-filter" : "*",
"ext-mbstring" : "*",

"phpunit/phpunit" : "^11.5.41",
"ulrichsg/getopt-php" : ">=4.0.4",
"jbzoo/markdown" : "^7.0.1"
"jbzoo/markdown" : "^8.0"
},

"require-dev" : {
"jbzoo/toolbox-dev" : "^7.1",
"jbzoo/codestyle" : "^7.1.6",
"jbzoo/http-client" : "^7.1",
"jbzoo/data" : "^7.1",
"jbzoo/utils" : "^7.2",
"jbzoo/toolbox-dev" : "^8.0",
"jbzoo/codestyle" : "^8.0",
"jbzoo/data" : "^8.0",
"jbzoo/utils" : "^8.0",
"jbzoo/http-client" : "^8.0",

"guzzlehttp/guzzle" : ">=7.10.0",
"symfony/process" : ">=7.3.4"
Expand All @@ -66,7 +66,7 @@

"extra" : {
"branch-alias" : {
"dev-master" : "7.x-dev"
"dev-master" : "8.x-dev"
}
}
}
18 changes: 8 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@
@copyright Copyright (C) JBZoo.com, All rights reserved.
@see https://github.com/JBZoo/PHPUnit
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="tests/autoload.php"
verbose="true"
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<phpunit bootstrap="tests/autoload.php" colors="true">
<coverage>
<report>
<clover outputFile="build/coverage_xml/main.xml"/>
<html outputDirectory="build/coverage_html" lowUpperBound="75" highLowerBound="95"/>
Expand All @@ -37,4 +29,10 @@
<logging>
<junit outputFile="build/coverage_junit/main.xml"/>
</logging>

<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion src/fake-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

$cliOptions->process(Env::string('PHPUNINT_ARGUMENTS'));

$realIndex = (string)($realIndex ?? \realpath($cliOptions->getOption('index')));
$realIndex = (string)($realIndex ?? \realpath((string)$cliOptions->getOption('index')));

if (\class_exists(CovCatcher::class) && Sys::hasXdebug()) {
$testname = (string)data($_REQUEST)->get('testname');
Expand Down
8 changes: 3 additions & 5 deletions src/functions/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ function isFalse(mixed $value, string $message = ''): void
}

/**
* @param string $expected
* @param mixed $className
* @param class-string $expected
* @param mixed $className
*
* @psalm-template ExpectedType of object
* @psalm-param class-string<ExpectedType> $expected
* @phan-suppress PhanPluginCanUseParamType
* @phan-suppress PhanPluginCanUseParamType
*/
function isClass($expected, $className, string $message = ''): void
{
Expand Down
Loading