You are here

public function PathUtilityTest::testAdd in Drupal 7 to 8/9 Module Upgrader 8

Same name in this branch
  1. 8 tests/src/Unit/Utility/Path/Drupal7/PathUtilityTest.php \Drupal\Tests\drupalmoduleupgrader\Unit\Utility\Path\Drupal7\PathUtilityTest::testAdd()
  2. 8 tests/src/Unit/Utility/Path/Drupal8/PathUtilityTest.php \Drupal\Tests\drupalmoduleupgrader\Unit\Utility\Path\Drupal8\PathUtilityTest::testAdd()

File

tests/src/Unit/Utility/Path/Drupal8/PathUtilityTest.php, line 23

Class

PathUtilityTest
@group DMU.Utility.Path

Namespace

Drupal\Tests\drupalmoduleupgrader\Unit\Utility\Path\Drupal8

Code

public function testAdd() {
  $path = clone $this->path;
  $path
    ->add('baz');
  $this
    ->assertCount(5, $path);
  $this
    ->assertInstanceOf('Drupal\\drupalmoduleupgrader\\Utility\\Path\\Drupal8\\PathComponent', $path
    ->last());
  $this
    ->assertEquals('baz', $path
    ->last()
    ->__toString());
  $path
    ->add(new PathComponent('wambooli'));
  $this
    ->assertCount(6, $path);
  $this
    ->assertEquals('wambooli', $path
    ->last()
    ->__toString());
}