You are here

public function MetatagImportTest::testBadData in Metatag Import Export CSV 8

Tests handling of badly-formed CSV data.

@dataProvider providerBadData

Parameters

array $headers: The row of CSV headers.

array $data: A row of mocked CSV data.

File

tests/src/Kernel/MetatagImportTest.php, line 241

Class

MetatagImportTest
Tests importing CSV data.

Namespace

Drupal\Tests\metatag_import_export_csv\Kernel

Code

public function testBadData($headers, $data) {
  $node = $this->entityTypeManager
    ->getStorage('node')
    ->create([
    'type' => 'page',
    'title' => 'Title',
  ]);
  $node
    ->save();
  $this
    ->expectException(\Exception::class);
  MetatagImport::importCsvRow($headers, $data);
}