You are here

public function PathTest::valuesProvider in Feeds 8.3

Data provider for ::testPrepareValue().

File

tests/src/Unit/Feeds/Target/PathTest.php, line 73

Class

PathTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\Path @group feeds

Namespace

Drupal\Tests\feeds\Unit\Feeds\Target

Code

public function valuesProvider() {
  return [
    'without-slash' => [
      'expected' => '/path',
      'values' => [
        'alias' => 'path ',
      ],
    ],
    'with-slash' => [
      'expected' => '/foo',
      'values' => [
        'alias' => '/foo ',
      ],
    ],
    'starting-with-space' => [
      'expected' => '/bar',
      'values' => [
        'alias' => ' bar',
      ],
    ],
    'starting-with-space-and-with-slash' => [
      'expected' => '/qux',
      'values' => [
        'alias' => ' /qux',
      ],
    ],
    'already-correctly-formatted' => [
      'expected' => '/foo-bar',
      'values' => [
        'alias' => '/foo-bar',
      ],
    ],
  ];
}