From 519e298887a26973844b11ba0dda53f8a65f22f7 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Thu, 2 Feb 2023 18:00:17 +0100 Subject: [PATCH 1/3] feat: initial test for rollbar/rollbar v4 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 024e9d7..43af597 100755 --- a/composer.json +++ b/composer.json @@ -28,18 +28,18 @@ }, "require": { "php": ">=8.0.2", - "rollbar/rollbar": "^3.1", + "rollbar/rollbar": "dev-master", "symfony/dependency-injection": "^5.4|^6.0", "symfony/config": "^5.4|^6.0", "symfony/http-kernel": "^5.4|^6.0", - "symfony/monolog-bundle": "^3.0", + "symfony/monolog-bundle": "^3.8", "symfony/serializer": "^5.4|^6.0", "ext-json": "*" }, "require-dev": { "phpunit/phpunit": "^9.5", "symfony/framework-bundle": "^5.4|^6.0", - "squizlabs/php_codesniffer": "^3.6", + "squizlabs/php_codesniffer": "^3.7", "matthiasnoback/symfony-dependency-injection-test": "^4.3" }, "scripts": { From 124c9e1589cc7b6e006759f7a9977685e73adafb Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sun, 16 Apr 2023 18:05:35 +0700 Subject: [PATCH 2/3] feat: initial test for rollbar/rollbar v4 --- Tests/Fixtures/App/config/config.yml | 2 +- Tests/Fixtures/ErrorHandler.php | 42 ---------------------------- composer.json | 17 ++++++----- 3 files changed, 9 insertions(+), 52 deletions(-) delete mode 100755 Tests/Fixtures/ErrorHandler.php diff --git a/Tests/Fixtures/App/config/config.yml b/Tests/Fixtures/App/config/config.yml index 4fbf716..bbaeb5d 100755 --- a/Tests/Fixtures/App/config/config.yml +++ b/Tests/Fixtures/App/config/config.yml @@ -5,7 +5,7 @@ parameters: framework: test: true - secret: "%secret%" + secret: "%secret%" router: resource: "%kernel.project_dir%/config/routing.yml" strict_requirements: ~ diff --git a/Tests/Fixtures/ErrorHandler.php b/Tests/Fixtures/ErrorHandler.php deleted file mode 100755 index c8e4ef3..0000000 --- a/Tests/Fixtures/ErrorHandler.php +++ /dev/null @@ -1,42 +0,0 @@ -assert = $assert; - } - - /** - * Writes the record down to the log of the implementing handler - */ - protected function write(array $record): void - { - $dummy = static function () { - }; - - $closure = empty($this->assert) ? $dummy : $this->assert; - $closure($record); - } -} diff --git a/composer.json b/composer.json index 43af597..f08f304 100755 --- a/composer.json +++ b/composer.json @@ -21,24 +21,23 @@ }, "autoload-dev": { "files": [ - "Tests/Fixtures/App/AppKernel.php", - "Tests/Fixtures/ErrorHandler.php" + "Tests/Fixtures/App/AppKernel.php" ], "psr-4": { "Tests\\": "Tests/"} }, "require": { "php": ">=8.0.2", - "rollbar/rollbar": "dev-master", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", + "rollbar/rollbar": "^3.1|^4.0", + "symfony/dependency-injection": "^5.4|^6.2", + "symfony/config": "^5.4|^6.2", + "symfony/http-kernel": "^5.4|^6.2", "symfony/monolog-bundle": "^3.8", - "symfony/serializer": "^5.4|^6.0", + "symfony/serializer": "^5.4|^6.2", "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "^9.5", - "symfony/framework-bundle": "^5.4|^6.0", + "phpunit/phpunit": "^9.6", + "symfony/framework-bundle": "^5.4|^6.2", "squizlabs/php_codesniffer": "^3.7", "matthiasnoback/symfony-dependency-injection-test": "^4.3" }, From c206a0cc65a9bd38dfcaa761ef7fef6e3e440539 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sun, 30 Apr 2023 06:12:59 +0200 Subject: [PATCH 3/3] feat: initial test for rollbar/rollbar v4, allow phpunit 10 --- .github/workflows/code_checks.yaml | 2 +- .gitignore | 1 + .../RollbarExtensionTest.php | 2 +- Tests/Payload/ErrorItemTest.php | 2 +- composer.json | 2 +- phpunit.xml | 17 +++++++++++------ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/code_checks.yaml b/.github/workflows/code_checks.yaml index b37e54d..827fa38 100644 --- a/.github/workflows/code_checks.yaml +++ b/.github/workflows/code_checks.yaml @@ -34,4 +34,4 @@ jobs: run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests - run: vendor/bin/phpunit --verbose + run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 546b65c..1f47029 100755 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /var/ !/var/.gitkeep .phpunit.result.cache +.phpunit.cache composer.lock clover.xml \ No newline at end of file diff --git a/Tests/DependencyInjection/RollbarExtensionTest.php b/Tests/DependencyInjection/RollbarExtensionTest.php index abe9293..64f8d46 100755 --- a/Tests/DependencyInjection/RollbarExtensionTest.php +++ b/Tests/DependencyInjection/RollbarExtensionTest.php @@ -37,7 +37,7 @@ public function testConfigVars(string $var, array $expected, array $loadParamete /** * Data provider generatorConfigVars. */ - public function generatorConfigVars(): array + public static function generatorConfigVars(): array { return [ ['rollbar.config', ['enabled' => true]], diff --git a/Tests/Payload/ErrorItemTest.php b/Tests/Payload/ErrorItemTest.php index ba85910..14d4c38 100755 --- a/Tests/Payload/ErrorItemTest.php +++ b/Tests/Payload/ErrorItemTest.php @@ -36,7 +36,7 @@ public function testInvoke(int $code, string $message, string $file, int $line, * * @throws \Exception */ - public function generateInvoke(): array + public static function generateInvoke(): array { return [ [E_ERROR, 'Error message - ' . microtime(true), __FILE__, random_int(1, 100), 'E_ERROR'], diff --git a/composer.json b/composer.json index f08f304..9055b44 100755 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^9.6|^10.1", "symfony/framework-bundle": "^5.4|^6.2", "squizlabs/php_codesniffer": "^3.7", "matthiasnoback/symfony-dependency-injection-test": "^4.3" diff --git a/phpunit.xml b/phpunit.xml index 9fb371f..b1d3551 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,11 +1,11 @@ - - - - ./ - - + + @@ -20,4 +20,9 @@ Tests/ + + + ./ + +