From a72b480505ced38dda464f3ba87b452b372dde89 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Mon, 19 Feb 2018 18:55:50 +0200 Subject: [PATCH] Display a more meaningful error message in case of misspelt module name unit test. --- .../Magento/Framework/Module/Test/Unit/DirTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php index 335228888cc4b..055e4be71baf1 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php @@ -59,4 +59,17 @@ public function testGetDirModuleSubDirUnknown() $this->_model->getDir('Test_Module', 'unknown'); } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Module 'Test Module' is not correctly registered. + */ + public function testGetDirModuleIncorrectlyRegistered() + { + $this->moduleRegistryMock->expects($this->once()) + ->method('getPath') + ->with($this->identicalTo(ComponentRegistrar::MODULE), $this->identicalTo('Test Module')) + ->willReturn(null); + $this->_model->getDir('Test Module'); + } }