X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Ftests%2Fsrc%2FUnit%2FPlugin%2FDMU%2FFixer%2FNotifyTest.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Ftests%2Fsrc%2FUnit%2FPlugin%2FDMU%2FFixer%2FNotifyTest.php;h=0ba10b06a9826d07e00a8195fa4e324a52dca272;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/tests/src/Unit/Plugin/DMU/Fixer/NotifyTest.php b/web/modules/contrib/drupalmoduleupgrader/tests/src/Unit/Plugin/DMU/Fixer/NotifyTest.php new file mode 100644 index 000000000..0ba10b06a --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/tests/src/Unit/Plugin/DMU/Fixer/NotifyTest.php @@ -0,0 +1,51 @@ +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()); + } + +}