3 namespace Drupal\Tests\drupalmoduleupgrader\Unit\Plugin\DMU\Converter\Functions;
8 * @group DMU.Converter.Functions
9 * @covers \Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions\FormLoadInclude
11 class FormLoadIncludeTest extends FunctionCallModifierTestBase {
13 public function testRewriteWithoutName() {
14 $function_call = Parser::parseExpression('form_load_include($form_state, "inc", "mod_foo")');
15 $rewritten = $this->plugin->rewrite($function_call, $this->target);
16 $this->assertInstanceOf('\Pharborist\Objects\ObjectMethodCallNode', $rewritten);
17 $this->assertEquals('$form_state->loadInclude("mod_foo", "inc")', $rewritten->getText());
20 public function testRewriteWithName() {
21 $function_call = Parser::parseExpression('form_load_include($form_state, "inc", "mod_foo", "bazzle")');
22 $rewritten = $this->plugin->rewrite($function_call, $this->target);
23 $this->assertInstanceOf('\Pharborist\Objects\ObjectMethodCallNode', $rewritten);
24 $this->assertEquals('$form_state->loadInclude("mod_foo", "inc", "bazzle")', $rewritten->getText());