You are here

public function FlysystemFactoryTest::testEnsureReturnsErrors in Flysystem 8

Same name and namespace in other branches
  1. 3.x tests/src/Unit/FlysystemFactoryTest.php \Drupal\Tests\flysystem\Unit\FlysystemFactoryTest::testEnsureReturnsErrors()
  2. 2.0.x tests/src/Unit/FlysystemFactoryTest.php \Drupal\Tests\flysystem\Unit\FlysystemFactoryTest::testEnsureReturnsErrors()
  3. 3.0.x tests/src/Unit/FlysystemFactoryTest.php \Drupal\Tests\flysystem\Unit\FlysystemFactoryTest::testEnsureReturnsErrors()

@covers ::ensure

File

tests/src/Unit/FlysystemFactoryTest.php, line 163

Class

FlysystemFactoryTest
@coversDefaultClass \Drupal\flysystem\FlysystemFactory @group flysystem

Namespace

Drupal\Tests\flysystem\Unit

Code

public function testEnsureReturnsErrors() {
  new Settings([
    'flysystem' => [
      'testscheme' => [
        'driver' => 'testdriver',
      ],
    ],
  ]);
  $this->plugin
    ->ensure(FALSE)
    ->willReturn([
    [
      'severity' => 'bad',
      'message' => 'Something bad',
      'context' => [],
    ],
  ]);
  $errors = $this
    ->getFactory()
    ->ensure();
  $this
    ->assertSame('Something bad', $errors['testscheme'][0]['message']);
}