Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bee50d4

Browse files
committed
minor #20228 PHP CS Fixer: use php_unit_dedicate_assert (keradus)
This PR was merged into the 2.7 branch. Discussion ---------- PHP CS Fixer: use php_unit_dedicate_assert | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | see CIs | Fixed tickets | n/a | License | MIT | Doc PR | n/a appendix for #19121 Commits ------- b0df3a7 PHP CS Fixer: use php_unit_dedicate_assert
2 parents 287713f + b0df3a7 commit bee50d4

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

.php_cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ return Symfony\CS\Config\Config::create()
66
->fixers(array(
77
'long_array_syntax',
88
'php_unit_construct',
9+
'php_unit_dedicate_assert',
910
))
1011
->finder(
1112
Symfony\CS\Finder\DefaultFinder::create()

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testProfilerIsDisabled($insulate)
3030
$client->enableProfiler();
3131
$crawler = $client->request('GET', '/profiler');
3232
$profile = $client->getProfile();
33-
$this->assertTrue(is_object($profile));
33+
$this->assertInternalType('object', $profile);
3434

3535
$client->request('GET', '/profiler');
3636
$this->assertFalse($client->getProfile());

src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testCacheIsProperlyWarmedWhenTemplatingIsAvailable()
2828
$warmer->enableOptionalWarmers();
2929
$warmer->warmUp($kernel->getCacheDir());
3030

31-
$this->assertTrue(file_exists($kernel->getCacheDir().'/twig'));
31+
$this->assertFileExists($kernel->getCacheDir().'/twig');
3232
}
3333

3434
public function testCacheIsNotWarmedWhenTemplatingIsDisabled()
@@ -40,7 +40,7 @@ public function testCacheIsNotWarmedWhenTemplatingIsDisabled()
4040
$warmer->enableOptionalWarmers();
4141
$warmer->warmUp($kernel->getCacheDir());
4242

43-
$this->assertFalse(file_exists($kernel->getCacheDir().'/twig'));
43+
$this->assertFileNotExists($kernel->getCacheDir().'/twig');
4444
}
4545

4646
protected function setUp()

src/Symfony/Component/Form/Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testValidationGroupsCanBeSetToCallback()
5858
'validation_groups' => array($this, 'testValidationGroupsCanBeSetToCallback'),
5959
));
6060

61-
$this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups')));
61+
$this->assertInternalType('callable', $form->getConfig()->getOption('validation_groups'));
6262
}
6363

6464
public function testValidationGroupsCanBeSetToClosure()
@@ -67,7 +67,7 @@ public function testValidationGroupsCanBeSetToClosure()
6767
'validation_groups' => function (FormInterface $form) { },
6868
));
6969

70-
$this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups')));
70+
$this->assertInternalType('callable', $form->getConfig()->getOption('validation_groups'));
7171
}
7272

7373
abstract protected function createForm(array $options = array());

src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function testOverloadCannotBeEvaluatedLazilyWithoutExpectedClosureParams(
275275
});
276276

277277
$resolved = $this->options->resolve();
278-
$this->assertTrue(is_callable($resolved['foo']));
278+
$this->assertInternalType('callable', $resolved['foo']);
279279
}
280280

281281
public function testOverloadCannotBeEvaluatedLazilyWithoutFirstParamTypeHint()
@@ -287,7 +287,7 @@ public function testOverloadCannotBeEvaluatedLazilyWithoutFirstParamTypeHint()
287287
});
288288

289289
$resolved = $this->options->resolve();
290-
$this->assertTrue(is_callable($resolved['foo']));
290+
$this->assertInternalType('callable', $resolved['foo']);
291291
}
292292

293293
public function testRemoveOptionAndNormalizer()

src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testDumpBackupsFileIfExisting()
3030
$dumper = new ConcreteFileDumper();
3131
$dumper->dump($catalogue, array('path' => $tempDir));
3232

33-
$this->assertTrue(file_exists($backupFile));
33+
$this->assertFileExists($backupFile);
3434

3535
@unlink($file);
3636
@unlink($backupFile);
@@ -49,7 +49,7 @@ public function testDumpCreatesNestedDirectoriesAndFile()
4949
$dumper->setRelativePathTemplate('test/translations/%domain%.%locale%.%extension%');
5050
$dumper->dump($catalogue, array('path' => $tempDir));
5151

52-
$this->assertTrue(file_exists($file));
52+
$this->assertFileExists($file);
5353

5454
@unlink($file);
5555
@rmdir($translationsDir);

0 commit comments

Comments
 (0)