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
49 changes: 0 additions & 49 deletions .circleci/config.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 🏗 Build

on:
pull_request:
types: [ synchronize, opened, reopened, ready_for_review ]
push:
branches: [ main ]

permissions:
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
prefer_lowest: ["", "--prefer-lowest"]
container:
image: skpr/php-cli:8.4-dev-v2-latest
options:
--pull always
--user 1001:1001
steps:
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
- name: 📦 Composer Update
run: composer update --with-all-dependencies --prefer-dist --no-progress --no-interaction ${{ matrix.prefer_lowest }}
- name: 🧹 PHPCS
run: ./bin/phpcs --report=checkstyle -q | ./bin/cs2pr
- name: 🧹 PHPStan
run: ./bin/phpstan --error-format=github analyse -v
- name: ➕ Add matcher
run: |
cat << 'EOF' > .github/phpunit-failure.json
{"problemMatcher":[{"owner":"phpunit-failure","severity":"error","pattern":[{"regexp":"##teamcity\\[testFailed[^\\]]*message='([^']*)'[^\\]]*details='/data/([^:]+):(\\d+)","message":1,"file":2,"line":3}]}]}
EOF
echo "::add-matcher::.github/phpunit-failure.json"
- name: ⚡ Run Tests
run: ./bin/phpunit --teamcity
- name: ➖ Remove matcher
if: always()
run: echo "::remove-matcher owner=phpunit-failure::"
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
],
"require": {
"php": "^8.1",
"phpunit/phpunit": "^10.5",
"symfony/console": "^6.4||^7"
"phpunit/phpunit": "^10.5||^11.5",
"symfony/console": "^6.4||^7.4"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"drupal/coder": "~8.3.12",
"phpcompatibility/php-compatibility": "^9.3"
"dealerdirect/phpcodesniffer-composer-installer": "^1.2",
"drupal/coder": "~8.3.31",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-deprecation-rules": "^2.0",
"staabm/annotate-pull-request-from-checkstyle": "^1.8"
},
"autoload": {
"psr-4": {"PhpUnitFinder\\": "src/"}
Expand Down
6 changes: 6 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
paths:
- src
- tests
level: 6
reportUnmatchedIgnoredErrors: false
7 changes: 1 addition & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- TODO set checkForUnintentionallyCoveredCode="true" once https://www.drupal.org/node/2626832 is resolved. -->
<!-- PHPUnit expects functional tests to be run with either a privileged user
or your current system user. See core/tests/README.md and
https://www.drupal.org/node/2116263 for details.
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" beStrictAboutChangesToGlobalState="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" beStrictAboutChangesToGlobalState="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd">
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
Expand Down
12 changes: 3 additions & 9 deletions tests/Unit/FinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@ class FinderTest extends TestCase {
/**
* A stub test.
*/
public function testDiscovery() {
public function testDiscovery(): void {
$command = new CommandTester(new FinderCommand());
$command->execute([
'--config-file' => dirname(__DIR__) . '/fixtures/phpunit.xml'
]);
$output = $command->getDisplay();
$this->assertNotNull($output);
if (method_exists($this, 'assertStringContainsString')) {
$this->assertStringContainsString('TestUnitTest.php', $output);
$this->assertStringContainsString('TestFunctionalTest.php', $output);
return;
}
$this->assertContains('TestUnitTest.php', $output);
$this->assertContains('TestFunctionalTest.php', $output);
$this->assertStringContainsString('TestUnitTest.php', $output);
$this->assertStringContainsString('TestFunctionalTest.php', $output);
}

}
2 changes: 1 addition & 1 deletion tests/fixtures/tests/Functional/TestFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestFunctionalTest extends TestCase {
/**
* Tests something.
*/
public function testSomething() {
public function testSomething(): void {
$this->addToAssertionCount(1);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/tests/Unit/TestUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestUnitTest extends TestCase {
/**
* Tests something.
*/
public function testSomething() {
public function testSomething(): void {
$this->addToAssertionCount(1);
}

Expand Down