public function setUp()
    {
        parent::setUp();
        $code = <<<'END'
<?php

/**
 * Implements hook_uninstall().
 */
function foo_uninstall() {
  variable_del('foo_baz');
}
END;
        $this->dir->getChild('foo.install')->setContent($code);
        $indexer = new Functions([], 'function', [], $this->db, $this->target);
        $indexer->build();
        $this->container->get('plugin.manager.drupalmoduleupgrader.indexer')->method('createInstance')->with('function')->willReturn($indexer);
        $this->analyzer = $this->getPlugin();
    }
    public function setUp()
    {
        parent::setUp();
        $code = <<<'END'
<?php

/**
 * Implements hook_block_info().
 */
function foo_block_info() {
  return array();
}
END;
        $this->dir->getChild('foo.module')->setContent($code);
        $indexer = new Functions([], 'function', [], $this->db, $this->target);
        $indexer->build();
        $this->container->get('plugin.manager.drupalmoduleupgrader.indexer')->method('createInstance')->with('function')->willReturn($indexer);
        $this->analyzer = $this->getPlugin([], ['hook' => 'block_info']);
    }
    public function setUp()
    {
        parent::setUp();
        $code = <<<'END'
<?php

/**
 * Implements hook_form_alter().
 */
function foo_form_alter(array &$form, array &$form_state, $form_id) {
}

/**
 * Implements hook_form_FORM_ID_alter().
 */
function foo_form_blarg_alter(array &$form, array &$form_state) {
}
END;
        $this->dir->getChild('foo.module')->setContent($code);
        $function_indexer = new Functions([], 'function', [], $this->db, $this->target);
        $function_indexer->build();
        $this->container->get('plugin.manager.drupalmoduleupgrader.indexer')->method('createInstance')->with('function')->willReturn($function_indexer);
        $this->analyzer = $this->getPlugin();
    }
    public function test()
    {
        $code = <<<'END'
<?php

function foo_permission() {
  return array(
    'bazify' => array(
      'title' => 'Do snazzy bazzy things',
    ),
  );
}
END;
        $this->dir->getChild('foo.module')->setContent($code);
        $indexer = new Functions([], 'function', [], $this->db, $this->target);
        $indexer->build();
        $this->container->get('plugin.manager.drupalmoduleupgrader.indexer')->method('createInstance')->with('function')->willReturn($indexer);
        $config = ['type' => 'function', 'id' => 'hook_permission'];
        $plugin = new Delete($config, uniqid(), []);
        $plugin->setTarget($this->target);
        $plugin->execute();
        $this->assertFalse($indexer->has('permission'));
        $this->assertEquals("<?php\n\n", $this->dir->getChild('foo.module')->getContent());
    }