Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite5c7c6b

Browse files
committed
[PhpUnitBridge] install PHPUnit 7 on PHP 7.1 and fix requirement for PHPUnit 6
1 parentc7fe1b6 commite5c7c6b

File tree

7 files changed

+32
-13
lines changed

7 files changed

+32
-13
lines changed

‎phpunit‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
77
echo"Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";
88
exit(1);
99
}
10-
if (\PHP_VERSION_ID >=70000 && !getenv('SYMFONY_PHPUNIT_VERSION')) {
11-
putenv('SYMFONY_PHPUNIT_VERSION=6.5');
10+
11+
if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
12+
if (\PHP_VERSION_ID >=70100) {
13+
// PHPUnit 7 requires PHP 7.1+
14+
putenv('SYMFONY_PHPUNIT_VERSION=7.4');
15+
}elseif (\PHP_VERSION_ID >=70000) {
16+
// PHPUnit 6 requires PHP 7.0+
17+
putenv('SYMFONY_PHPUNIT_VERSION=6.5');
18+
}elseif (\PHP_VERSION_ID >=50600) {
19+
// PHPUnit 5 requires PHP 5.6+
20+
putenv('SYMFONY_PHPUNIT_VERSION=5.7');
21+
}else {
22+
// PHPUnit 4.8 requires PHP 5.3.3+
23+
putenv('SYMFONY_PHPUNIT_VERSION=4.8');
24+
}
1225
}
26+
1327
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
1428
require__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';

‎src/Symfony/Bridge/PhpUnit/bin/simple-phpunit‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ $getEnvVar = function ($name, $default = false) {
4545
return$default;
4646
};
4747

48-
if (PHP_VERSION_ID >=70200) {
49-
// PHPUnit 6 is required for PHP 7.2+
48+
if (PHP_VERSION_ID >=70100) {
49+
// PHPUnit 7 requires PHP 7.1+
50+
$PHPUNIT_VERSION =$getEnvVar('SYMFONY_PHPUNIT_VERSION','7.4');
51+
}elseif (PHP_VERSION_ID >=70000) {
52+
// PHPUnit 6 requires PHP 7.0+
5053
$PHPUNIT_VERSION =$getEnvVar('SYMFONY_PHPUNIT_VERSION','6.5');
5154
}elseif (PHP_VERSION_ID >=50600) {
52-
// PHPUnit4 does not supportPHP7
55+
// PHPUnit5 requiresPHP5.6+
5356
$PHPUNIT_VERSION =$getEnvVar('SYMFONY_PHPUNIT_VERSION','5.7');
5457
}else {
55-
// PHPUnit5.1 requires PHP 5.6+
58+
// PHPUnit4.8 requires PHP 5.3.3+
5659
$PHPUNIT_VERSION ='4.8';
5760
}
5861

‎src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformerTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class DateTimeToHtml5LocalDateTimeTransformerTestextends TestCase
1818
{
19-
publicstaticfunctionassertEquals($expected,$actual,$message ='',$delta =0,$maxDepth =10,$canonicalize =false,$ignoreCase =false)
19+
publicstaticfunctionassertEquals($expected,$actual,string$message ='',float$delta =0.0,int$maxDepth =10,bool$canonicalize =false,bool$ignoreCase =false):void
2020
{
2121
if ($expectedinstanceof \DateTime &&$actualinstanceof \DateTime) {
2222
$expected =$expected->format('c');

‎src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function tearDown()
3939
$this->dateTimeWithoutSeconds =null;
4040
}
4141

42-
publicstaticfunctionassertEquals($expected,$actual,$message ='',$delta =0,$maxDepth =10,$canonicalize =false,$ignoreCase =false)
42+
publicstaticfunctionassertEquals($expected,$actual,string$message ='',float$delta =0.0,int$maxDepth =10,bool$canonicalize =false,bool$ignoreCase =false):void
4343
{
4444
if ($expectedinstanceof \DateTime &&$actualinstanceof \DateTime) {
4545
$expected =$expected->format('c');

‎src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function tearDown()
3333
$this->dateTimeWithoutSeconds =null;
3434
}
3535

36-
publicstaticfunctionassertEquals($expected,$actual,$message ='',$delta =0,$maxDepth =10,$canonicalize =false,$ignoreCase =false)
36+
publicstaticfunctionassertEquals($expected,$actual,string$message ='',float$delta =0.0,int$maxDepth =10,bool$canonicalize =false,bool$ignoreCase =false):void
3737
{
3838
if ($expectedinstanceof \DateTime &&$actualinstanceof \DateTime) {
3939
$expected =$expected->format('c');

‎src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespaceSymfony\Component\Validator\Tests\DataCollector;
1313

14+
usePHPUnit\Framework\MockObject\MockObject;
1415
usePHPUnit\Framework\TestCase;
1516
useSymfony\Component\Validator\ConstraintViolation;
1617
useSymfony\Component\Validator\ConstraintViolationList;
@@ -72,8 +73,8 @@ public function testReset()
7273
$this->assertSame(0,$collector->getViolationsCount());
7374
}
7475

75-
protectedfunctioncreateMock($classname)
76+
protectedfunctioncreateMock($originalClassName):MockObject
7677
{
77-
return$this->getMockBuilder($classname)->disableOriginalConstructor()->getMock();
78+
return$this->getMockBuilder($originalClassName)->disableOriginalConstructor()->getMock();
7879
}
7980
}

‎src/Symfony/Component/Validator/Tests/Validator/TraceableValidatorTest.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespaceSymfony\Component\Validator\Tests\Validator;
1313

14+
usePHPUnit\Framework\MockObject\MockObject;
1415
usePHPUnit\Framework\TestCase;
1516
useSymfony\Component\Validator\Constraint;
1617
useSymfony\Component\Validator\ConstraintViolation;
@@ -97,8 +98,8 @@ public function testForwardsToOriginalValidator()
9798
$this->assertSame($expected,$validator->validatePropertyValue(new \stdClass(),'property','value'),'returns original validator validatePropertyValue() result');
9899
}
99100

100-
protectedfunctioncreateMock($classname)
101+
protectedfunctioncreateMock($originalClassName):MockObject
101102
{
102-
return$this->getMockBuilder($classname)->disableOriginalConstructor()->getMock();
103+
return$this->getMockBuilder($originalClassName)->disableOriginalConstructor()->getMock();
103104
}
104105
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp