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

Commit389b3a7

Browse files
committed
Fix deprecation on 4.3
1 parent36466a3 commit389b3a7

File tree

12 files changed

+62
-45
lines changed

12 files changed

+62
-45
lines changed

‎.travis.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ env:
2222
-SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1
2323
-MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
2424
-MESSENGER_REDIS_DSN=redis://127.0.0.1:7001/messages
25+
-SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1
2526

2627
matrix:
2728
include:
@@ -30,6 +31,9 @@ matrix:
3031
env:deps=high
3132
-php:7.3
3233
env:deps=low
34+
-php:7.4snapshot
35+
allow_failures:
36+
-php:7.4snapshot
3337
fast_finish:true
3438

3539
cache:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function testGetMetadata()
120120
CacheItem::METADATA_EXPIRY =>9.5 +time(),
121121
CacheItem::METADATA_CTIME =>1000,
122122
];
123-
$this->assertEquals($expected,$item->getMetadata(),'Item metadata should embed expiry and ctime.',.6);
123+
$this->assertEqualsWithDelta($expected,$item->getMetadata(),.6,'Item metadata should embed expiry and ctime.');
124124
}
125125

126126
publicfunctiontestDefaultLifeTime()

‎src/Symfony/Component/Config/Tests/Definition/Builder/NodeDefinitionTest.php‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,25 @@
1414
usePHPUnit\Framework\TestCase;
1515
useSymfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
1616
useSymfony\Component\Config\Definition\Builder\NodeDefinition;
17-
useSymfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
1817

1918
class NodeDefinitionTestextends TestCase
2019
{
21-
publicfunctiontestDefaultPathSeparatorIsDot()
22-
{
23-
$node =$this->getMockForAbstractClass(NodeDefinition::class, ['foo']);
24-
25-
$this->assertAttributeSame('.','pathSeparator',$node);
26-
}
27-
2820
publicfunctiontestSetPathSeparatorChangesChildren()
2921
{
30-
$node =newArrayNodeDefinition('foo');
31-
$scalar =newScalarNodeDefinition('bar');
32-
$node->append($scalar);
33-
34-
$node->setPathSeparator('/');
35-
36-
$this->assertAttributeSame('/','pathSeparator',$node);
37-
$this->assertAttributeSame('/','pathSeparator',$scalar);
22+
$parentNode =newArrayNodeDefinition('name');
23+
$childNode =$this->createMock(NodeDefinition::class);
24+
25+
$childNode
26+
->expects($this->once())
27+
->method('setPathSeparator')
28+
->with('/');
29+
$childNode
30+
->expects($this->once())
31+
->method('setParent')
32+
->with($parentNode)
33+
->willReturn($childNode);
34+
$parentNode->append($childNode);
35+
36+
$parentNode->setPathSeparator('/');
3837
}
3938
}

‎src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
235235
if ($parameter->isDefaultValueAvailable()) {
236236
$value =$parameter->getDefaultValue();
237237
}elseif (!$parameter->allowsNull()) {
238-
thrownewAutowiringFailedException($this->currentId,$failureMessage);
238+
thrownewAutowiringFailedException($this->currentId,$failureMessage());
239239
}
240240
}
241241

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public function testChoiceTranslationLocaleOption()
5151
->createView()->vars['choices'];
5252

5353
// Don't check objects for identity
54-
$this->assertContains(newChoiceView('DE','DE','Німеччина'),$choices,'',false,false);
55-
$this->assertContains(newChoiceView('GB','GB','Велика Британія'),$choices,'',false,false);
56-
$this->assertContains(newChoiceView('US','US','Сполучені Штати'),$choices,'',false,false);
57-
$this->assertContains(newChoiceView('FR','FR','Франція'),$choices,'',false,false);
58-
$this->assertContains(newChoiceView('MY','MY','Малайзія'),$choices,'',false,false);
54+
$this->assertContainsEquals(newChoiceView('DE','DE','Німеччина'),$choices);
55+
$this->assertContainsEquals(newChoiceView('GB','GB','Велика Британія'),$choices);
56+
$this->assertContainsEquals(newChoiceView('US','US','Сполучені Штати'),$choices);
57+
$this->assertContainsEquals(newChoiceView('FR','FR','Франція'),$choices);
58+
$this->assertContainsEquals(newChoiceView('MY','MY','Малайзія'),$choices);
5959
}
6060

6161
publicfunctiontestUnknownCountryIsNotIncluded()

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public function testChoiceTranslationLocaleOption()
4848
->createView()->vars['choices'];
4949

5050
// Don't check objects for identity
51-
$this->assertContains(newChoiceView('EUR','EUR','євро'),$choices,'',false,false);
52-
$this->assertContains(newChoiceView('USD','USD','долар США'),$choices,'',false,false);
53-
$this->assertContains(newChoiceView('SIT','SIT','словенський толар'),$choices,'',false,false);
51+
$this->assertContainsEquals(newChoiceView('EUR','EUR','євро'),$choices);
52+
$this->assertContainsEquals(newChoiceView('USD','USD','долар США'),$choices);
53+
$this->assertContainsEquals(newChoiceView('SIT','SIT','словенський толар'),$choices);
5454
}
5555

5656
publicfunctiontestSubmitNull($expected =null,$norm =null,$view =null)

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ public function testChoiceTranslationLocaleOption()
5050
->createView()->vars['choices'];
5151

5252
// Don't check objects for identity
53-
$this->assertContains(newChoiceView('en','en','англійська'),$choices,'',false,false);
54-
$this->assertContains(newChoiceView('en_US','en_US','англійська (США)'),$choices,'',false,false);
55-
$this->assertContains(newChoiceView('fr','fr','французька'),$choices,'',false,false);
56-
$this->assertContains(newChoiceView('my','my','бірманська'),$choices,'',false,false);
53+
$this->assertContainsEquals(newChoiceView('en','en','англійська'),$choices);
54+
$this->assertContainsEquals(newChoiceView('en_US','en_US','англійська (США)'),$choices);
55+
$this->assertContainsEquals(newChoiceView('fr','fr','французька'),$choices);
56+
$this->assertContainsEquals(newChoiceView('my','my','бірманська'),$choices);
5757
}
5858

5959
publicfunctiontestMultipleLanguagesIsNotIncluded()

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public function testChoiceTranslationLocaleOption()
4848
->createView()->vars['choices'];
4949

5050
// Don't check objects for identity
51-
$this->assertContains(newChoiceView('en','en','англійська'),$choices,'',false,false);
52-
$this->assertContains(newChoiceView('en_GB','en_GB','англійська (Велика Британія)'),$choices,'',false,false);
53-
$this->assertContains(newChoiceView('zh_Hant_MO','zh_Hant_MO','китайська (традиційна, Макао, О.А.Р Китаю)'),$choices,'',false,false);
51+
$this->assertContainsEquals(newChoiceView('en','en','англійська'),$choices);
52+
$this->assertContainsEquals(newChoiceView('en_GB','en_GB','англійська (Велика Британія)'),$choices);
53+
$this->assertContainsEquals(newChoiceView('zh_Hant_MO','zh_Hant_MO','китайська (традиційна, Макао, О.А.Р Китаю)'),$choices);
5454
}
5555

5656
publicfunctiontestSubmitNull($expected =null,$norm =null,$view =null)

‎src/Symfony/Component/Mailer/Tests/Transport/AbstractTransportTest.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ public function testThrottling()
3131

3232
$start =time();
3333
$transport->send($message,$envelope);
34-
$this->assertEquals(0,time() -$start,'',1);
34+
$this->assertEqualsWithDelta(0,time() -$start,1);
3535
$transport->send($message,$envelope);
36-
$this->assertEquals(5,time() -$start,'',1);
36+
$this->assertEqualsWithDelta(5,time() -$start,1);
3737
$transport->send($message,$envelope);
38-
$this->assertEquals(10,time() -$start,'',1);
38+
$this->assertEqualsWithDelta(10,time() -$start,1);
3939
$transport->send($message,$envelope);
40-
$this->assertEquals(15,time() -$start,'',1);
40+
$this->assertEqualsWithDelta(15,time() -$start,1);
4141

4242
$start =time();
4343
$transport->setMaxPerSecond(-3);
4444
$transport->send($message,$envelope);
45-
$this->assertEquals(0,time() -$start,'',1);
45+
$this->assertEqualsWithDelta(0,time() -$start,1);
4646
$transport->send($message,$envelope);
47-
$this->assertEquals(0,time() -$start,'',1);
47+
$this->assertEqualsWithDelta(0,time() -$start,1);
4848
}
4949
}

‎src/Symfony/Component/Messenger/Tests/Handler/HandlersLocatorTest.php‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class HandlersLocatorTest extends TestCase
2222
{
2323
publicfunctiontestItYieldsHandlerDescriptors()
2424
{
25-
$handler =$this->createPartialMock(\stdClass::class, ['__invoke']);
25+
$handler =$this->createPartialMock(HandlersLocatorTestCallable::class, ['__invoke']);
2626
$locator =newHandlersLocator([
2727
DummyMessage::class => [$handler],
2828
]);
@@ -32,13 +32,13 @@ public function testItYieldsHandlerDescriptors()
3232

3333
publicfunctiontestItReturnsOnlyHandlersMatchingTransport()
3434
{
35-
$firstHandler =$this->createPartialMock(\stdClass::class, ['__invoke']);
36-
$secondHandler =$this->createPartialMock(\stdClass::class, ['__invoke']);
35+
$firstHandler =$this->createPartialMock(HandlersLocatorTestCallable::class, ['__invoke']);
36+
$secondHandler =$this->createPartialMock(HandlersLocatorTestCallable::class, ['__invoke']);
3737

3838
$locator =newHandlersLocator([
3939
DummyMessage::class => [
4040
$first =newHandlerDescriptor($firstHandler, ['alias' =>'one']),
41-
newHandlerDescriptor($this->createPartialMock(\stdClass::class, ['__invoke']), ['from_transport' =>'ignored','alias' =>'two']),
41+
newHandlerDescriptor($this->createPartialMock(HandlersLocatorTestCallable::class, ['__invoke']), ['from_transport' =>'ignored','alias' =>'two']),
4242
$second =newHandlerDescriptor($secondHandler, ['from_transport' =>'transportName','alias' =>'three']),
4343
],
4444
]);
@@ -51,3 +51,10 @@ public function testItReturnsOnlyHandlersMatchingTransport()
5151
)));
5252
}
5353
}
54+
55+
class HandlersLocatorTestCallable
56+
{
57+
publicfunction__invoke()
58+
{
59+
}
60+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp