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

Commit442cf59

Browse files
Merge branch '2.8' into 3.2
* 2.8: Use PHPUnit 6.0 on PHP 7.* test lines
2 parents94146f9 +5db127b commit442cf59

File tree

16 files changed

+174
-20
lines changed

16 files changed

+174
-20
lines changed

‎phpunit‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/usr/bin/env php
22
<?php
33

4-
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/d3157d942a4590121dfd23f9cadf519ca6ad4ac7
4+
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/2a45e94c3cde63d8cdfa729e51b80f85b1ab37f6
55

66
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.0');
12+
}
1013
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
1114
require__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';

‎src/Symfony/Bridge/Doctrine/composer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"require-dev": {
2424
"symfony/stopwatch":"~2.8|~3.0",
2525
"symfony/dependency-injection":"~2.8|~3.0",
26-
"symfony/form":"^3.0.5",
26+
"symfony/form":"^3.2.5",
2727
"symfony/http-kernel":"~2.8|~3.0",
2828
"symfony/property-access":"~2.8|~3.0",
2929
"symfony/property-info":"~2.8|3.0",
3030
"symfony/proxy-manager-bridge":"~2.8|~3.0",
3131
"symfony/security":"~2.8|~3.0",
3232
"symfony/expression-language":"~2.8|~3.0",
33-
"symfony/validator":"~2.8|~3.0",
33+
"symfony/validator":"^2.8.18|^3.2.5",
3434
"symfony/translation":"~2.8|~3.0",
3535
"doctrine/data-fixtures":"1.0.*",
3636
"doctrine/dbal":"~2.4",

‎src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ require_once __DIR__.'/../../bootstrap.php';
1818

1919
@trigger_error('root deprecation',E_USER_DEPRECATED);
2020

21+
eval(<<<'EOPHP'
22+
namespace PHPUnit\Util;
23+
24+
class Test
25+
{
26+
public static function getGroups()
27+
{
28+
return array();
29+
}
30+
}
31+
EOPHP
32+
);
33+
2134
class PHPUnit_Util_Test
2235
{
2336
publicstaticfunctiongetGroups()

‎src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111

1212
namespaceSymfony\Bridge\PhpUnit\Tests;
1313

14+
usePHPUnit\Framework\TestCase;
1415
useSymfony\Bridge\PhpUnit\DnsMock;
1516

16-
class DnsMockTestextends\PHPUnit_Framework_TestCase
17+
class DnsMockTestextendsTestCase
1718
{
1819
protectedfunctiontearDown()
1920
{

‎src/Symfony/Bridge/Twig/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require-dev": {
2323
"symfony/asset":"~2.8|~3.0",
2424
"symfony/finder":"~2.8|~3.0",
25-
"symfony/form":"~3.1.9|^3.2.2",
25+
"symfony/form":"^3.2.5",
2626
"symfony/http-kernel":"~3.2",
2727
"symfony/polyfill-intl-icu":"~1.0",
2828
"symfony/routing":"~2.8|~3.0",

‎src/Symfony/Bundle/FrameworkBundle/composer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/config":"~2.8|~3.0",
2424
"symfony/event-dispatcher":"~2.8|~3.0",
2525
"symfony/http-foundation":"~3.1",
26-
"symfony/http-kernel":"~3.2.2|~3.3",
26+
"symfony/http-kernel":"^3.2.5",
2727
"symfony/polyfill-mbstring":"~1.0",
2828
"symfony/filesystem":"~2.8|~3.0",
2929
"symfony/finder":"~2.8|~3.0",
@@ -41,7 +41,7 @@
4141
"symfony/dom-crawler":"~2.8|~3.0",
4242
"symfony/polyfill-intl-icu":"~1.0",
4343
"symfony/security":"~2.8|~3.0",
44-
"symfony/form":"~2.8.16|~3.1.9|^3.2.2",
44+
"symfony/form":"^2.8.18|^3.2.5",
4545
"symfony/expression-language":"~2.8|~3.0",
4646
"symfony/process":"~2.8|~3.0",
4747
"symfony/security-core":"~3.2",

‎src/Symfony/Bundle/SecurityBundle/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"symfony/css-selector":"~2.8|~3.0",
2929
"symfony/dom-crawler":"~2.8|~3.0",
3030
"symfony/form":"~2.8|~3.0",
31-
"symfony/framework-bundle":"~3.1",
31+
"symfony/framework-bundle":"^3.2.5",
3232
"symfony/http-foundation":"~2.8|~3.0",
3333
"symfony/security-acl":"~2.8|~3.0",
3434
"symfony/templating":"~2.8|~3.0",

‎src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313

1414
useCache\IntegrationTests\CachePoolTest;
1515

16+
if (!class_exists('PHPUnit_Framework_TestCase')) {
17+
abstractclass AdapterTestCase
18+
{
19+
publicstaticfunctionsetUpBeforeClass()
20+
{
21+
self::markTestSkipped('cache/integration-tests is not yet compatible with namespaced phpunit versions.');
22+
}
23+
}
24+
25+
return;
26+
}
27+
1628
abstractclass AdapterTestCaseextends CachePoolTest
1729
{
1830
protectedfunctionsetUp()

‎src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php‎

Lines changed: 117 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
namespaceSymfony\Component\Console\Tests\Logger;
1313

14-
usePsr\Log\Test\LoggerInterfaceTest;
14+
usePHPUnit\Framework\TestCase;
15+
usePsr\Log\LoggerInterface;
1516
usePsr\Log\LogLevel;
1617
useSymfony\Component\Console\Logger\ConsoleLogger;
1718
useSymfony\Component\Console\Output\BufferedOutput;
@@ -22,16 +23,17 @@
2223
* Console logger test.
2324
*
2425
* @author Kévin Dunglas <dunglas@gmail.com>
26+
* @author Jordi Boggiano <j.boggiano@seld.be>
2527
*/
26-
class ConsoleLoggerTestextendsLoggerInterfaceTest
28+
class ConsoleLoggerTestextendsTestCase
2729
{
2830
/**
2931
* @var DummyOutput
3032
*/
3133
protected$output;
3234

3335
/**
34-
*{@inheritdoc}
36+
*@return LoggerInterface
3537
*/
3638
publicfunctiongetLogger()
3739
{
@@ -50,7 +52,9 @@ public function getLogger()
5052
}
5153

5254
/**
53-
* {@inheritdoc}
55+
* Return the log messages in order.
56+
*
57+
* @return string[]
5458
*/
5559
publicfunctiongetLogs()
5660
{
@@ -101,4 +105,113 @@ public function testHasErrored()
101105
$logger->error('bar');
102106
$this->assertTrue($logger->hasErrored());
103107
}
108+
109+
publicfunctiontestImplements()
110+
{
111+
$this->assertInstanceOf('Psr\Log\LoggerInterface',$this->getLogger());
112+
}
113+
114+
/**
115+
* @dataProvider provideLevelsAndMessages
116+
*/
117+
publicfunctiontestLogsAtAllLevels($level,$message)
118+
{
119+
$logger =$this->getLogger();
120+
$logger->{$level}($message,array('user' =>'Bob'));
121+
$logger->log($level,$message,array('user' =>'Bob'));
122+
123+
$expected =array(
124+
$level.' message of level'.$level.' with context: Bob',
125+
$level.' message of level'.$level.' with context: Bob',
126+
);
127+
$this->assertEquals($expected,$this->getLogs());
128+
}
129+
130+
publicfunctionprovideLevelsAndMessages()
131+
{
132+
returnarray(
133+
LogLevel::EMERGENCY =>array(LogLevel::EMERGENCY,'message of level emergency with context: {user}'),
134+
LogLevel::ALERT =>array(LogLevel::ALERT,'message of level alert with context: {user}'),
135+
LogLevel::CRITICAL =>array(LogLevel::CRITICAL,'message of level critical with context: {user}'),
136+
LogLevel::ERROR =>array(LogLevel::ERROR,'message of level error with context: {user}'),
137+
LogLevel::WARNING =>array(LogLevel::WARNING,'message of level warning with context: {user}'),
138+
LogLevel::NOTICE =>array(LogLevel::NOTICE,'message of level notice with context: {user}'),
139+
LogLevel::INFO =>array(LogLevel::INFO,'message of level info with context: {user}'),
140+
LogLevel::DEBUG =>array(LogLevel::DEBUG,'message of level debug with context: {user}'),
141+
);
142+
}
143+
144+
/**
145+
* @expectedException \Psr\Log\InvalidArgumentException
146+
*/
147+
publicfunctiontestThrowsOnInvalidLevel()
148+
{
149+
$logger =$this->getLogger();
150+
$logger->log('invalid level','Foo');
151+
}
152+
153+
publicfunctiontestContextReplacement()
154+
{
155+
$logger =$this->getLogger();
156+
$logger->info('{Message {nothing} {user} {foo.bar} a}',array('user' =>'Bob','foo.bar' =>'Bar'));
157+
158+
$expected =array('info {Message {nothing} Bob Bar a}');
159+
$this->assertEquals($expected,$this->getLogs());
160+
}
161+
162+
publicfunctiontestObjectCastToString()
163+
{
164+
if (method_exists($this,'createPartialMock')) {
165+
$dummy =$this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest',array('__toString'));
166+
}else {
167+
$dummy =$this->getMock('Symfony\Component\Console\Tests\Logger\DummyTest',array('__toString'));
168+
}
169+
$dummy->expects($this->once())
170+
->method('__toString')
171+
->will($this->returnValue('DUMMY'));
172+
173+
$this->getLogger()->warning($dummy);
174+
175+
$expected =array('warning DUMMY');
176+
$this->assertEquals($expected,$this->getLogs());
177+
}
178+
179+
publicfunctiontestContextCanContainAnything()
180+
{
181+
$context =array(
182+
'bool' =>true,
183+
'null' =>null,
184+
'string' =>'Foo',
185+
'int' =>0,
186+
'float' =>0.5,
187+
'nested' =>array('with object' =>newDummyTest()),
188+
'object' =>new \DateTime(),
189+
'resource' =>fopen('php://memory','r'),
190+
);
191+
192+
$this->getLogger()->warning('Crazy context data',$context);
193+
194+
$expected =array('warning Crazy context data');
195+
$this->assertEquals($expected,$this->getLogs());
196+
}
197+
198+
publicfunctiontestContextExceptionKeyCanBeExceptionOrOtherValues()
199+
{
200+
$logger =$this->getLogger();
201+
$logger->warning('Random message',array('exception' =>'oops'));
202+
$logger->critical('Uncaught Exception!',array('exception' =>new \LogicException('Fail')));
203+
204+
$expected =array(
205+
'warning Random message',
206+
'critical Uncaught Exception!',
207+
);
208+
$this->assertEquals($expected,$this->getLogs());
209+
}
210+
}
211+
212+
class DummyTest
213+
{
214+
publicfunction__toString()
215+
{
216+
}
104217
}

‎src/Symfony/Component/Form/composer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"require": {
1919
"php":">=5.5.9",
2020
"symfony/event-dispatcher":"~2.8|~3.0",
21-
"symfony/intl":"~2.8|~3.0",
21+
"symfony/intl":"^2.8.18|^3.2.5",
2222
"symfony/options-resolver":"~2.8|~3.0",
2323
"symfony/polyfill-mbstring":"~1.0",
2424
"symfony/property-access":"~2.8|~3.0"
2525
},
2626
"require-dev": {
2727
"doctrine/collections":"~1.0",
28-
"symfony/validator":"~2.8|~3.0",
28+
"symfony/validator":"^2.8.18|^3.2.5",
2929
"symfony/dependency-injection":"~2.8|~3.0",
3030
"symfony/http-foundation":"~2.8|~3.0",
3131
"symfony/http-kernel":"~2.8|~3.0",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp