Skip to content

Commit

Permalink
Merge branch '8.5' into 9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 19, 2023
2 parents f1060f8 + c61908f commit b92dfee
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'const' => 'none',
'method' => 'one',
'property' => 'one'
]
Expand Down
3 changes: 0 additions & 3 deletions src/Framework/MockObject/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public function __clone(): void
}
}
EOT;

private const MOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT'
namespace PHPUnit\Framework\MockObject;
Expand All @@ -84,7 +83,6 @@ public function __clone()
}
}
EOT;

private const UNMOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT = <<<'EOT'
namespace PHPUnit\Framework\MockObject;
Expand All @@ -98,7 +96,6 @@ public function __clone(): void
}
}
EOT;

private const UNMOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT'
namespace PHPUnit\Framework\MockObject;
Expand Down
1 change: 0 additions & 1 deletion src/TextUI/CliArguments/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ final class Builder
'whitelist=',
'dump-xdebug-filter=',
];

private const SHORT_OPTIONS = 'd:c:hv';

public function fromParameters(array $parameters, array $additionalLongOptions): Configuration
Expand Down
24 changes: 8 additions & 16 deletions src/TextUI/DefaultResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,15 @@
*/
class DefaultResultPrinter extends Printer implements ResultPrinter
{
public const EVENT_TEST_START = 0;

public const EVENT_TEST_END = 1;

public const EVENT_TEST_START = 0;
public const EVENT_TEST_END = 1;
public const EVENT_TESTSUITE_START = 2;

public const EVENT_TESTSUITE_END = 3;

public const COLOR_NEVER = 'never';

public const COLOR_AUTO = 'auto';

public const COLOR_ALWAYS = 'always';

public const COLOR_DEFAULT = self::COLOR_NEVER;

private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS];
public const EVENT_TESTSUITE_END = 3;
public const COLOR_NEVER = 'never';
public const COLOR_AUTO = 'auto';
public const COLOR_ALWAYS = 'always';
public const COLOR_DEFAULT = self::COLOR_NEVER;
private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS];

/**
* @var int
Expand Down
3 changes: 1 addition & 2 deletions src/TextUI/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
final class Help
{
private const LEFT_MARGIN = ' ';

private const HELP_TEXT = [
private const HELP_TEXT = [
'Usage' => [
['text' => 'phpunit [options] UnitTest.php'],
['text' => 'phpunit [options] <directory>'],
Expand Down
6 changes: 2 additions & 4 deletions src/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@
*/
final class TestRunner extends BaseTestRunner
{
public const SUCCESS_EXIT = 0;

public const FAILURE_EXIT = 1;

public const SUCCESS_EXIT = 0;
public const FAILURE_EXIT = 1;
public const EXCEPTION_EXIT = 2;

/**
Expand Down
15 changes: 5 additions & 10 deletions src/Util/Annotation/DocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,12 @@ final class DocBlock
*/
public const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/';

private const REGEX_REQUIRES_VERSION = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m';

private const REGEX_REQUIRES_VERSION = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m';
private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<constraint>[\d\t \-.|~^]+)[ \t]*\r?$/m';

private const REGEX_REQUIRES_OS = '/@requires\s+(?P<name>OS(?:FAMILY)?)\s+(?P<value>.+?)[ \t]*\r?$/m';

private const REGEX_REQUIRES_SETTING = '/@requires\s+(?P<name>setting)\s+(?P<setting>([^ ]+?))\s*(?P<value>[\w\.-]+[\w\.]?)?[ \t]*\r?$/m';

private const REGEX_REQUIRES = '/@requires\s+(?P<name>function|extension)\s+(?P<value>([^\s<>=!]+))\s*(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+[\d\.]?)?[ \t]*\r?$/m';

private const REGEX_TEST_WITH = '/@testWith\s+/';
private const REGEX_REQUIRES_OS = '/@requires\s+(?P<name>OS(?:FAMILY)?)\s+(?P<value>.+?)[ \t]*\r?$/m';
private const REGEX_REQUIRES_SETTING = '/@requires\s+(?P<name>setting)\s+(?P<setting>([^ ]+?))\s*(?P<value>[\w\.-]+[\w\.]?)?[ \t]*\r?$/m';
private const REGEX_REQUIRES = '/@requires\s+(?P<name>function|extension)\s+(?P<value>([^\s<>=!]+))\s*(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+[\d\.]?)?[ \t]*\r?$/m';
private const REGEX_TEST_WITH = '/@testWith\s+/';

/** @var string */
private $docComment;
Expand Down
1 change: 0 additions & 1 deletion src/Util/TestDox/CliTestDoxPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class CliTestDoxPrinter extends TestDoxPrinter
" \e[36m◑\e[0m running tests",
" \e[36m◒\e[0m running tests",
];

private const STATUS_STYLES = [
BaseTestRunner::STATUS_PASSED => [
'symbol' => '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
*/
final class SeparateClassRunMethodInNewProcessTest extends TestCase
{
public const PROCESS_ID_FILE_PATH = __DIR__ . '/parent_process_id.txt';

public const PROCESS_ID_FILE_PATH = __DIR__ . '/parent_process_id.txt';
public const INITIAL_PARENT_PROCESS_ID = 0;

public const INITIAL_PROCESS_ID = 1;
public const INITIAL_PROCESS_ID = 1;

public static $parentProcessId = self::INITIAL_PARENT_PROCESS_ID;

Expand Down
4 changes: 0 additions & 4 deletions tests/unit/Runner/PhptTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ final class PhptTestCaseTest extends TestCase
--EXPECT--
Hello PHPUnit!
EOF;

private const EXPECTF_CONTENT = <<<'EOF'
--TEST--
EXPECTF test
Expand All @@ -40,7 +39,6 @@ final class PhptTestCaseTest extends TestCase
--EXPECTF--
Hello %s!
EOF;

private const EXPECTREGEX_CONTENT = <<<'EOF'
--TEST--
EXPECTREGEX test
Expand All @@ -49,15 +47,13 @@ final class PhptTestCaseTest extends TestCase
--EXPECTREGEX--
Hello [HPU]{4}[nit]{3}!
EOF;

private const EXPECT_MISSING_ASSERTION_CONTENT = <<<'EOF'
--TEST--
Missing EXPECTF value test
--EXPECTF--
--FILE--
<?php echo "Hello PHPUnit!"; ?>
EOF;

private const FILE_SECTION = <<<'EOF'
<?php echo "Hello PHPUnit!"; ?>

Expand Down
3 changes: 1 addition & 2 deletions tests/unit/Runner/TestSuiteSorterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ final class TestSuiteSorterTest extends TestCase
*/
private const IGNORE_DEPENDENCIES = false;

private const RESOLVE_DEPENDENCIES = true;

private const RESOLVE_DEPENDENCIES = true;
private const MULTIDEPENDENCYTEST_EXECUTION_ORDER = [
MultiDependencyTest::class . '::testOne',
MultiDependencyTest::class . '::testTwo',
Expand Down

0 comments on commit b92dfee

Please sign in to comment.