Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/phpunit-bridge
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.4.19
Choose a base ref
...
head repository: symfony/phpunit-bridge
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.4.21
Choose a head ref
  • 4 commits
  • 6 files changed
  • 4 contributors

Commits on Jan 24, 2023

  1. Copy the full SHA
    4716bf9 View commit details

Commits on Feb 14, 2023

  1. Copy the full SHA
    8a9b99a View commit details

Commits on Feb 15, 2023

  1. Copy the full SHA
    90c5169 View commit details

Commits on Feb 16, 2023

  1. CS fix

    nicolas-grekas committed Feb 16, 2023
    Copy the full SHA
    28d8a15 View commit details
3 changes: 1 addition & 2 deletions ConstraintTrait.php
Original file line number Diff line number Diff line change
@@ -12,9 +12,8 @@
namespace Symfony\Bridge\PhpUnit;

use PHPUnit\Framework\Constraint\Constraint;
use ReflectionClass;

$r = new ReflectionClass(Constraint::class);
$r = new \ReflectionClass(Constraint::class);
if ($r->getProperty('exporter')->isProtected()) {
trait ConstraintTrait
{
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2023 Fabien Potencier
Copyright (c) 2014-present Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
24 changes: 19 additions & 5 deletions Tests/DeprecationErrorHandler/ConfigurationTest.php
Original file line number Diff line number Diff line change
@@ -179,7 +179,7 @@ public function testItCanTellWhetherToDisplayAStackTrace()
$this->assertTrue($configuration->shouldDisplayStackTrace('interesting'));
}

public function provideItCanBeDisabled(): array
public static function provideItCanBeDisabled(): array
{
return [
['disabled', false],
@@ -248,7 +248,7 @@ public function testToleratesForIndividualGroups(string $deprecationsHelper, arr
}
}

public function provideDataForToleratesForGroup() {
public static function provideDataForToleratesForGroup() {

yield 'total threshold not reached' => ['max[total]=1', [
'unsilenced' => 0,
@@ -482,10 +482,24 @@ public function testBaselineFileWriteError()
{
$filename = $this->createFile();
chmod($filename, 0444);
$this->expectError();
$this->expectErrorMessageMatches('/[Ff]ailed to open stream: Permission denied/');
$configuration = Configuration::fromUrlEncodedString('generateBaseline=true&baselineFile='.urlencode($filename));
$configuration->writeBaseline();

$this->expectException(\ErrorException::class);
$this->expectExceptionMessageMatches('/[Ff]ailed to open stream: Permission denied/');

set_error_handler(static function (int $errno, string $errstr, string $errfile = null, int $errline = null): bool {
if ($errno & (E_WARNING | E_WARNING)) {
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
}

return false;
});

try {
$configuration->writeBaseline();
} finally {
restore_error_handler();
}
}

protected function setUp(): void
6 changes: 3 additions & 3 deletions Tests/DeprecationErrorHandler/DeprecationTest.php
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ public function testItMutesOnlySpecificErrorMessagesWhenTheCallingCodeIsInPhpuni
$this->assertSame($muted, $deprecation->isMuted());
}

public function mutedProvider()
public static function mutedProvider()
{
yield 'not from phpunit, and not a whitelisted message' => [
false,
@@ -147,7 +147,7 @@ public function testItTakesMutesDeprecationFromPhpUnitFiles()
$this->assertTrue($deprecation->isMuted());
}

public function providerGetTypeDetectsSelf()
public static function providerGetTypeDetectsSelf()
{
return [
'not_from_vendors_file' => [Deprecation::TYPE_SELF, '', 'MyClass1', __FILE__],
@@ -182,7 +182,7 @@ public function testGetTypeDetectsSelf(string $expectedType, string $message, st
$this->assertSame($expectedType, $deprecation->getType());
}

public function providerGetTypeUsesRightTrace()
public static function providerGetTypeUsesRightTrace()
{
$vendorDir = self::getVendorDir();
$fakeTrace = [
1 change: 1 addition & 0 deletions Tests/ExpectDeprecationTraitTest.php
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ public function testOne()
* Do not remove this test in the next major version.
*
* @group legacy
*
* @runInSeparateProcess
*/
public function testOneInIsolation()
1 change: 1 addition & 0 deletions Tests/FailTests/ExpectDeprecationTraitTestFail.php
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ public function testOne()
* Do not remove this test in the next major version.
*
* @group legacy
*
* @runInSeparateProcess
*/
public function testOneInIsolation()