File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ namespace IntegerNet \AsyncVarnish \Test \Integration ;
5+
6+ use Magento \Framework \Component \ComponentRegistrar ;
7+ use Magento \Framework \Module \ModuleList ;
8+ use Magento \TestFramework \ObjectManager ;
9+ use PHPUnit \Framework \TestCase ;
10+
11+ class ModuleTest extends TestCase
12+ {
13+
14+ /**
15+ * @var ObjectManager
16+ */
17+ private $ objectManager ;
18+ const MODULE_NAME = 'IntegerNet_AsyncVarnish ' ;
19+ /**
20+ * @return ModuleList
21+ */
22+ private function getTestModuleList ()
23+ {
24+ /** @var ModuleList $moduleList */
25+ $ moduleList = $ this ->objectManager ->create (ModuleList::class);
26+ return $ moduleList ;
27+ }
28+ protected function setUp ()
29+ {
30+ $ this ->objectManager = ObjectManager::getInstance ();
31+ }
32+ public function testTheModuleIsRegistered ()
33+ {
34+ $ registrar = new ComponentRegistrar ();
35+ $ paths = $ registrar ->getPaths (ComponentRegistrar::MODULE );
36+ $ this ->assertArrayHasKey (self ::MODULE_NAME , $ paths , 'Module should be registered ' );
37+ }
38+ public function testTheModuleIsKnownAndEnabled ()
39+ {
40+ $ moduleList = $ this ->getTestModuleList ();
41+ $ this ->assertTrue ($ moduleList ->has (self ::MODULE_NAME ), 'Module should be enabled ' );
42+ }
43+
44+ }
You can’t perform that action at this time.
0 commit comments