8000 minor #32998 SCA: dropped unused mocks, duplicate import and a functi… · symfony/symfony@6d2e3ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d2e3ee

Browse files
minor #32998 SCA: dropped unused mocks, duplicate import and a function alias usage (kalessil)
This PR was squashed before being merged into the 3.4 branch (closes #32998). Discussion ---------- SCA: dropped unused mocks, duplicate import and a function alias usage | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 484668f SCA: dropped unused mocks, duplicate import and a function alias usage
2 parents 6af3c6b + 484668f commit 6d2e3ee

File tree

7 files changed

+4
-19
lines changed

7 files changed

+4
-19
lines changed

src/Symfony/Component/Config/Tests/Definition/Builder/NumericNodeDefinitionTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,22 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Config\Definition\Builder\FloatNodeDefinition;
1616
use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition;
17-
use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition as NumericNodeDefinition;
1817

1918
class NumericNodeDefinitionTest extends TestCase
2019
{
2120
public function testIncoherentMinAssertion()
2221
{
2322
$this->expectException('InvalidArgumentException');
2423
$this->expectExceptionMessage('You cannot define a min(4) as you already have a max(3)');
25-
$def = new NumericNodeDefinition('foo');
24+
$def = new IntegerNodeDefinition('foo');
2625
$def->max(3)->min(4);
2726
}
2827

2928
public function testIncoherentMaxAssertion()
3029
{
3130
$this->expectException('InvalidArgumentException');
3231
$this->expectExceptionMessage('You cannot define a max(2) as you already have a min(3)');
33-
$node = new NumericNodeDefinition('foo');
32+
$node = new IntegerNodeDefinition('foo');
3433
$node->min(3)->max(2);
3534
}
3635

@@ -84,7 +83,7 @@ public function testCannotBeEmptyThrowsAnException()
8483
{
8584
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidDefinitionException');
8685
$this->expectExceptionMessage('->cannotBeEmpty() is not applicable to NumericNodeDefinition.');
87-
$def = new NumericNodeDefinition('foo');
86+
$def = new IntegerNodeDefinition('foo');
8887
$def->cannotBeEmpty();
8988
}
9089
}

src/Symfony/Component/ExpressionLanguage/Tests/ExpressionLanguageTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public function testCachedParseWithDeprecatedParserCacheInterface()
7070
{
7171
$cacheMock = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface')->getMock();
7272

73-
$cacheItemMock = $this->getMockBuilder('Psr\Cache\CacheItemInterface')->getMock();
7473
$savedParsedExpression = null;
7574
$expressionLanguage = new ExpressionLanguage($cacheMock);
7675

src/Symfony/Component/Ldap/Tests/LdapTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function getLdapConfig()
1414
$this->markTestSkipped('No server is listening on LDAP_HOST:LDAP_PORT');
1515
}
1616

17-
ldap_close($h);
17+
ldap_unbind($h);
1818

1919
return [
2020
'host' => getenv('LDAP_HOST'),

src/Symfony/Component/Security/Guard/Tests/GuardAuthenticatorHandlerTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ public function testHandleAuthenticationFailure()
8585
*/
8686
public function testHandleAuthenticationClearsToken($tokenClass, $tokenProviderKey, $actualProviderKey)
8787
{
88-
$token = $this->getMockBuilder($tokenClass)
89-
->disableOriginalConstructor()
90-
->getMock();
91-
$token->expects($this->any())
92-
->method('getProviderKey')
93-
->willReturn($tokenProviderKey);
94-
9588
$this->tokenStorage->expects($this->never())
9689
->method('setToken')
9790
->with(null);

src/Symfony/Component/Security/Http/Tests/Firewall/BasicAuthenticationListenerTest.php

Expand all lines: src/Symfony/Component/Security/Http/Tests/Firewall/BasicAuthenticationListenerTest.php
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ public function testHandleWhenAuthenticationFails()
7474
'PHP_AUTH_PW' => 'ThePassword',
7575
]);
7676

77-
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
78-
7977
$tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
8078
$tokenStorage
8179
->expects($this->any())

src/Symfony/Component/Security/Http/Tests/RememberMe/AbstractRememberMeServicesTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function testLoginSuccessIsNotProcessedWhenTokenDoesNotContainUserInterfa
124124
$service = $this->getService(null, ['name' => 'foo', 'always_remember_me' => true, 'path' => null, 'domain' => null]);
125125
$request = new Request();
126126
$response = new Response();
127-
$account = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
128127
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
129128
$token
130129
->expects($this->once())

src/Symfony/Component/Translation/Tests/DependencyInjection/TranslationExtractorPassTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,11 @@ public function testProcessMissingAlias()
5050
{
5151
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
5252
$this->expectExceptionMessage('The alias for the tag "translation.extractor" of service "foo.id" must be set.');
53-
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->disableOriginalConstructor()->getMock();
5453
$container = new ContainerBuilder();
5554
$container->register('translation.extractor');
5655
$container->register('foo.id')
5756
->addTag('translation.extractor', []);
5857

59-
$definition->expects($this->never())->method('addMethodCall');
60-
6158
$translationDumperPass = new TranslationExtractorPass();
6259
$translationDumperPass->process($container);
6360
}

0 commit comments

Comments
 (0)
0