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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased] Unreleased

### Fixed

- Extensions event subscription to avoid type issues with newer PHP versions.

## [4.5.2] 2025-04-25;

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ back-compatibility purposes.
use lucatume\WPBrowser\TestCase\WPTestCase;

class MyTestUsingDeprecatedCode extends WPTestCase {
public function test_deprecatd_function() {
public function test_deprecated_function() {
// add_filter( 'deprecated_function_trigger_error', '__return_false' );
$this->setExpectedDeprecated( 'my_deprecated_function' );
my_deprecated_function();
Expand Down
8 changes: 4 additions & 4 deletions src/Extension/EventDispatcherBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
class EventDispatcherBridge extends Extension
{
/**
* @var array<string,string>
* @var array<string,array{0: string, 1: int}>
*/
public static array $events = [
Events::MODULE_INIT => 'onModuleInit',
Events::SUITE_INIT => 'onSuiteInit',
Events::SUITE_BEFORE => 'onSuiteBefore',
Events::MODULE_INIT => ['onModuleInit', 0 ],
Events::SUITE_INIT => ['onSuiteInit', 0],
Events::SUITE_BEFORE => ['onSuiteBefore', 0],
];
private bool $eventDispatcherCaptured = false;

Expand Down
8 changes: 4 additions & 4 deletions src/Extension/IsolationSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class IsolationSupport extends Extension
public const ISOLATED_PROCESS_PATCH_CONTEXT = 'Isolation-Support-Process';

/**
* @var array<string,string>
* @var array<string,array{0: string, 1: int}>
*/
public static array $events = [
Events::SUITE_INIT => 'onSuiteInit',
Events::TEST_START => 'onTestStart',
Events::TEST_FAIL => 'onTestFail',
Events::SUITE_INIT => ['onSuiteInit', 0],
Events::TEST_START => ['onTestStart', 0],
Events::TEST_FAIL => ['onTestFail', 0],
];

private string $processCode = <<< PHP
Expand Down
4 changes: 2 additions & 2 deletions src/Extension/ServiceExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
abstract class ServiceExtension extends Extension
{
/**
* @var array<string,string>
* @var array<string,array{0: string, 1: int}>
*/
public static array $events = [
Events::MODULE_INIT => 'onModuleInit',
Events::MODULE_INIT => ['onModuleInit', 0],
];

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/Symlinker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
class Symlinker extends Extension
{
/**
* @var array<string,string>
* @var array<string,array{0: string, 1: int}>
*/
protected static $events = [
Events::MODULE_INIT => 'onModuleInit',
Events::SUITE_AFTER => 'afterSuite',
Events::MODULE_INIT => ['onModuleInit', 0],
Events::SUITE_AFTER => ['afterSuite', 0],
];

private string $wpRootFolder = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private function should_pretty_print_serialized_closure_entry(): string
$serializableThrowable->colorize(false);
$serialized = serialize($serializableThrowable);
$unserialized = unserialize($serialized)->getThrowable(SerializableThrowable::RELATIVE_PAHTNAMES);
return StackTraceFilter::getFilteredStackTrace($unserialized);
return trim(StackTraceFilter::getFilteredStackTrace($unserialized));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
/tests/unit/lucatume/WPBrowser/Process/SerializableThrowableTest.php:1
/tests/unit/lucatume/WPBrowser/Process/SerializableThrowableTest.php:1
/vendor/symfony/console/Command/Command.php:1
/vendor/bin/codecept:1
/vendor/bin/codecept:1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
/tests/unit/lucatume/WPBrowser/Process/SerializableThrowableTest.php:1
/tests/unit/lucatume/WPBrowser/Process/SerializableThrowableTest.php:1
/vendor/symfony/console/Command/Command.php:1
/vendor/bin/codecept:1
/vendor/bin/codecept:1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
/tests/unit/lucatume/WPBrowser/Process/SerializableThrowableTest.php:1
/tests/unit/lucatume/WPBrowser/Process/SerializableThrowableTest.php:1
/vendor/symfony/console/Command/Command.php:1
/vendor/bin/codecept:1
/vendor/bin/codecept:1