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 testHookFormAlter() { $issues = $this->analyzer->analyze($this->target); $this->assertInternalType('array', $issues); $this->assertNotEmpty($issues); $this->assertIssueDefaults($issues[0]); $this->assertCount(2, $issues[0]->getViolations()); } public function testDerivedFormAlter() { $issues = $this->analyzer->analyze($this->target); $this->assertInternalType('array', $issues); $this->assertNotEmpty($issues); $this->assertIssueDefaults($issues[0]); $this->assertCount(2, $issues[0]->getViolations()); } }