From faf533194ecae4ad5ec5bb0add1f7be0010c12e7 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 dafff9d42254d..5346b4fc2b705 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php @@ -66,4 +66,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'); + } }