minor #25907 Improve assertions (carusogabriel)

This PR was merged into the 2.7 branch.

Discussion
----------

Improve assertions

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Following #25420 before start other branches.

Btw, the other branches are 2.8, 3.3, 3.4, 4.0 and master?

Commits
-------

3d90a2217d Improve assertions
This commit is contained in:
Fabien Potencier 2018-01-29 09:53:47 +01:00
commit d007bbd2e5

View File

@ -12,7 +12,6 @@
namespace Symfony\Component\Finder\Tests;
use Symfony\Component\Finder\Adapter\AdapterInterface;
use Symfony\Component\Finder\Adapter\GnuFindAdapter;
use Symfony\Component\Finder\Adapter\PhpAdapter;
use Symfony\Component\Finder\Finder;
@ -610,15 +609,15 @@ class FinderTest extends Iterator\RealIteratorTestCase
{
// test that by default, PhpAdapter is selected
$adapters = Finder::create()->getAdapters();
$this->assertTrue($adapters[0] instanceof PhpAdapter);
$this->assertInstanceOf('Symfony\Component\Finder\Adapter\PhpAdapter', $adapters[0]);
// test another adapter selection
$adapters = Finder::create()->setAdapter('gnu_find')->getAdapters();
$this->assertTrue($adapters[0] instanceof GnuFindAdapter);
$this->assertInstanceOf('Symfony\Component\Finder\Adapter\GnuFindAdapter', $adapters[0]);
// test that useBestAdapter method removes selection
$adapters = Finder::create()->useBestAdapter()->getAdapters();
$this->assertFalse($adapters[0] instanceof PhpAdapter);
$this->assertNotInstanceOf('Symfony\Component\Finder\Adapter\PhpAdapter', $adapters[0]);
}
public function getTestPathData()