dir->getChild('foo.module')->setContent(rtrim($code)); $indexer = new FunctionCalls([], 'function', ['exclude' => []], $this->db, $this->target); $indexer->build(); $this ->container ->get('plugin.manager.drupalmoduleupgrader.indexer') ->method('createInstance') ->with('function_call') ->willReturn($indexer); $config = [ 'type' => 'function_call', 'id' => 'variable_get', 'note' => 'This is no longer kosher!', ]; $plugin = new Disable($config, uniqID(), []); $plugin->setTarget($this->target); $plugin->execute(); $expected = <<assertEquals($expected, trim($this->dir->getChild('foo.module')->getContent())); } }