public function UpcastingTest::testSameTypes

Confirms we can upcast to controller arguments of the same type.

File

drupal/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php, line 68
Contains Drupal\system\Tests\ParamConverter\UpcastingTest.

Class

UpcastingTest
Web tests for the upcasting.

Namespace

Drupal\system\Tests\ParamConverter

Code

public function testSameTypes() {
  $node = $this
    ->drupalCreateNode(array(
    'title' => $this
      ->randomName(8),
  ));
  $parent = $this
    ->drupalCreateNode(array(
    'title' => $this
      ->randomName(8),
  ));

  // paramconverter_test/node/{node}/set/parent/{parent}
  // converters:
  //   parent: 'node'
  $this
    ->drupalGet("paramconverter_test/node/" . $node->nid . "/set/parent/" . $parent->nid);
  $this
    ->assertRaw("Setting '" . $parent->title . "' as parent of '" . $node->title . "'.");
}