Skip to content

Commit 2d1d3db

Browse files
author
Oleksii Korshenko
authored
MAGETWO-88040: Display a more meaningful error message in case of misspelt module name unit test. #13740
2 parents 5b37326 + d1134f7 commit 2d1d3db

File tree

1 file changed

+13
-0
lines changed
  • lib/internal/Magento/Framework/Module/Test/Unit

1 file changed

+13
-0
lines changed

lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,17 @@ public function testGetDirModuleSubDirUnknown()
5959

6060
$this->_model->getDir('Test_Module', 'unknown');
6161
}
62+
63+
/**
64+
* @expectedException \InvalidArgumentException
65+
* @expectedExceptionMessage Module 'Test Module' is not correctly registered.
66+
*/
67+
public function testGetDirModuleIncorrectlyRegistered()
68+
{
69+
$this->moduleRegistryMock->expects($this->once())
70+
->method('getPath')
71+
->with($this->identicalTo(ComponentRegistrar::MODULE), $this->identicalTo('Test Module'))
72+
->willReturn(null);
73+
$this->_model->getDir('Test Module');
74+
}
6275
}

0 commit comments

Comments
 (0)