From 7aff7f42c1e771995b1498e989307c4be1733f65 Mon Sep 17 00:00:00 2001 From: SpacePossum Date: Sun, 21 Feb 2016 12:34:19 +0100 Subject: [PATCH] PhpUnitNoDedicateAssertFixer results --- .../CollectionToArrayTransformerTest.php | 8 ++++---- .../Tests/Definition/Builder/TreeBuilderTest.php | 2 +- .../Component/Finder/Tests/Shell/CommandTest.php | 2 +- .../Component/HttpFoundation/Tests/File/FileTest.php | 12 ++++++------ .../HttpFoundation/Tests/File/UploadedFileTest.php | 4 ++-- .../HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php | 2 +- .../Data/Bundle/Reader/JsonBundleReaderTest.php | 2 +- .../Tests/Data/Bundle/Reader/PhpBundleReaderTest.php | 2 +- .../Security/Tests/Core/SecurityContextTest.php | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php index f8424dda9c..9426d5c09b 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php @@ -27,7 +27,7 @@ class CollectionToArrayTransformerTest extends Propel1TestCase { $result = $this->transformer->transform(new \PropelObjectCollection()); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertCount(0, $result); } @@ -35,7 +35,7 @@ class CollectionToArrayTransformerTest extends Propel1TestCase { $result = $this->transformer->transform(null); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertCount(0, $result); } @@ -54,7 +54,7 @@ class CollectionToArrayTransformerTest extends Propel1TestCase $result = $this->transformer->transform($coll); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertCount(2, $result); $this->assertEquals('foo', $result[0]); $this->assertEquals('bar', $result[1]); @@ -93,7 +93,7 @@ class CollectionToArrayTransformerTest extends Propel1TestCase $this->assertInstanceOf('\PropelObjectCollection', $result); - $this->assertTrue(is_array($data)); + $this->assertInternalType('array', $data); $this->assertCount(2, $data); $this->assertEquals('foo', $data[0]); $this->assertEquals('bar', $data[1]); diff --git a/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php b/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php index 00e27c630a..a146e89c32 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php @@ -120,7 +120,7 @@ class TreeBuilderTest extends \PHPUnit_Framework_TestCase $tree = $builder->buildTree(); $children = $tree->getChildren(); - $this->assertTrue(is_array($tree->getExample())); + $this->assertInternalType('array', $tree->getExample()); $this->assertEquals('example', $children['child']->getExample()); } } diff --git a/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php b/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php index e9145127ea..0c19ab47a8 100644 --- a/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php +++ b/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php @@ -146,7 +146,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase $cmd->add('--version'); $result = $cmd->execute(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertNotEmpty($result); $this->assertRegexp('/PHP|HipHop/', $result[0]); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php b/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php index 90a143367a..d9b9b1f7a3 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php @@ -81,8 +81,8 @@ class FileTest extends \PHPUnit_Framework_TestCase $movedFile = $file->move($targetDir); $this->assertInstanceOf('Symfony\Component\HttpFoundation\File\File', $movedFile); - $this->assertTrue(file_exists($targetPath)); - $this->assertFalse(file_exists($path)); + $this->assertFileExists($targetPath); + $this->assertFileNotExists($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); @@ -100,8 +100,8 @@ class FileTest extends \PHPUnit_Framework_TestCase $file = new File($path); $movedFile = $file->move($targetDir, 'test.newname.gif'); - $this->assertTrue(file_exists($targetPath)); - $this->assertFalse(file_exists($path)); + $this->assertFileExists($targetPath); + $this->assertFileNotExists($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); @@ -135,8 +135,8 @@ class FileTest extends \PHPUnit_Framework_TestCase $movedFile = $file->move($targetDir, $filename); $this->assertInstanceOf('Symfony\Component\HttpFoundation\File\File', $movedFile); - $this->assertTrue(file_exists($targetPath)); - $this->assertFalse(file_exists($path)); + $this->assertFileExists($targetPath); + $this->assertFileNotExists($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php index f6ea340091..2e2d27409c 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php @@ -164,8 +164,8 @@ class UploadedFileTest extends \PHPUnit_Framework_TestCase $movedFile = $file->move(__DIR__.'/Fixtures/directory'); - $this->assertTrue(file_exists($targetPath)); - $this->assertFalse(file_exists($path)); + $this->assertFileExists($targetPath); + $this->assertFileNotExists($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); diff --git a/src/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php b/src/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php index f0ab05d62e..fe5ecb2ed3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php @@ -32,7 +32,7 @@ class CacheWarmerTest extends \PHPUnit_Framework_TestCase $warmer = new TestCacheWarmer(self::$cacheFile); $warmer->warmUp(dirname(self::$cacheFile)); - $this->assertTrue(file_exists(self::$cacheFile)); + $this->assertFileExists(self::$cacheFile); } /** diff --git a/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/JsonBundleReaderTest.php b/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/JsonBundleReaderTest.php index 2cc4607b11..a6183edfe0 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/JsonBundleReaderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/JsonBundleReaderTest.php @@ -32,7 +32,7 @@ class JsonBundleReaderTest extends \PHPUnit_Framework_TestCase { $data = $this->reader->read(__DIR__.'/Fixtures/json', 'en'); - $this->assertTrue(is_array($data)); + $this->assertInternalType('array', $data); $this->assertSame('Bar', $data['Foo']); $this->assertFalse(isset($data['ExistsNot'])); } diff --git a/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/PhpBundleReaderTest.php b/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/PhpBundleReaderTest.php index 2beaec7ba2..3c58ee7c41 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/PhpBundleReaderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Bundle/Reader/PhpBundleReaderTest.php @@ -32,7 +32,7 @@ class PhpBundleReaderTest extends \PHPUnit_Framework_TestCase { $data = $this->reader->read(__DIR__.'/Fixtures/php', 'en'); - $this->assertTrue(is_array($data)); + $this->assertInternalType('array', $data); $this->assertSame('Bar', $data['Foo']); $this->assertFalse(isset($data['ExistsNot'])); } diff --git a/src/Symfony/Component/Security/Tests/Core/SecurityContextTest.php b/src/Symfony/Component/Security/Tests/Core/SecurityContextTest.php index 66958892d3..3fba8d958c 100644 --- a/src/Symfony/Component/Security/Tests/Core/SecurityContextTest.php +++ b/src/Symfony/Component/Security/Tests/Core/SecurityContextTest.php @@ -92,6 +92,6 @@ class SecurityContextTest extends \PHPUnit_Framework_TestCase public function testTranslationsAreNotInCore() { - $this->assertFalse(file_exists(__DIR__.'/../../Core/Resources/translations/')); + $this->assertFileNotExists(__DIR__.'/../../Core/Resources/translations/'); } }