setDocComment(DocCommentNode::create('Double wambooli!')); $this->assertInstanceOf('\Pharborist\DocCommentNode', $class->getDocComment()); $indexer = $this->getMock('\Drupal\drupalmoduleupgrader\IndexerInterface'); $indexer->method('get')->with('Wambooli')->willReturn(new NodeCollection([ $class ])); $this ->container ->get('plugin.manager.drupalmoduleupgrader.indexer') ->method('createInstance') ->with('class') ->willReturn($indexer); $config = [ 'type' => 'class', 'id' => 'Wambooli', 'note' => 'You need to rewrite this thing because I said so!', ]; $plugin = new Notify($config, uniqID(), []); $plugin->setTarget($this->target); $plugin->execute(); $comment = $class->getDocComment(); $this->assertInstanceOf('\Pharborist\DocCommentNode', $comment); $expected = <<assertEquals($expected, $comment->getCommentText()); } }