You are here

public function SpreadsheetIteratorTest::testGetOrigin in Migrate Spreadsheet 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/SpreadsheetIteratorTest.php \Drupal\Tests\migrate_spreadsheet\Unit\SpreadsheetIteratorTest::testGetOrigin()

@covers ::getOrigin @dataProvider providerTestGetException

Parameters

string $origin: The origin cell reference to be tested.

bool $expect_exception: If a exception is expected.

File

tests/src/Unit/SpreadsheetIteratorTest.php, line 65

Class

SpreadsheetIteratorTest
Tests the spreadsheet iterator.

Namespace

Drupal\Tests\migrate_spreadsheet\Unit

Code

public function testGetOrigin($origin, $expect_exception) {
  $config = [
    'origin' => $origin,
  ] + $this->iterator
    ->getConfiguration();
  $this->iterator
    ->setConfiguration($config);
  if ($expect_exception) {
    $this
      ->setExpectedException('InvalidArgumentException');
  }
  $this
    ->assertEquals($origin, $this->iterator
    ->getOrigin());
}