minor #17872 [CS] PHPUnit dedicate assert fixer acceptance test (SpacePossum)

This PR was merged into the 2.3 branch.

Discussion
----------

[CS] PHPUnit dedicate assert fixer acceptance test

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| License       | MIT

The goal of this PR is _not_ to have it merge, but to check with SF community if a new Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1792) should be added to the set of Symfony fixers (at PHP-CS-Fixer).

Commits
-------

7aff7f4 PhpUnitNoDedicateAssertFixer results
This commit is contained in:
Fabien Potencier 2016-02-22 16:29:01 +01:00
commit 9124c28b10
9 changed files with 18 additions and 18 deletions

View File

@ -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]);

View File

@ -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());
}
}

View File

@ -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]);
}

View File

@ -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);

View File

@ -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);

View File

@ -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);
}
/**

View File

@ -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']));
}

View File

@ -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']));
}

View File

@ -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/');
}
}