From 316cb497294509b834245f4bbd62423528609f02 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 11 Aug 2023 22:17:10 +0900 Subject: [PATCH] Update unit test for ModuleActionParser --- tests/_data/module/module.xml | 4 ++++ tests/unit/framework/parsers/ModuleActionParserTest.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/_data/module/module.xml b/tests/_data/module/module.xml index ce887491e..eb6a6284d 100644 --- a/tests/_data/module/module.xml +++ b/tests/_data/module/module.xml @@ -37,6 +37,10 @@ + + + + diff --git a/tests/unit/framework/parsers/ModuleActionParserTest.php b/tests/unit/framework/parsers/ModuleActionParserTest.php index f52b86bee..57439bcaf 100644 --- a/tests/unit/framework/parsers/ModuleActionParserTest.php +++ b/tests/unit/framework/parsers/ModuleActionParserTest.php @@ -70,7 +70,7 @@ class ModuleActionParserTest extends \Codeception\TestCase\Test $this->assertTrue(is_object($info->event_handlers[0])); $this->assertEquals('document.insertDocument', $info->event_handlers[0]->event_name); $this->assertEquals('after', $info->event_handlers[0]->position); - $this->assertEquals('Controllers\\Triggers', $info->event_handlers[0]->class_name); + $this->assertEquals('\\VendorName\\Hello\\World\\Controllers\\Triggers', $info->event_handlers[0]->class_name); $this->assertEquals('triggerAfterInsertDocument', $info->event_handlers[0]->method); $this->assertTrue(is_object($info->event_handlers[1])); $this->assertEquals('act:document.procDocumentVoteUp', $info->event_handlers[1]->event_name); @@ -78,6 +78,10 @@ class ModuleActionParserTest extends \Codeception\TestCase\Test $this->assertEquals('controller', $info->event_handlers[1]->class_name); $this->assertEquals('triggerBeforeDocumentVoteUp', $info->event_handlers[1]->method); + // Custom classes + $this->assertEquals('Custom\\DefaultClass', $info->classes['default']); + $this->assertEquals('Custom\\InstallClass', $info->classes['install']); + // Custom namespaces $this->assertTrue(is_array($info->namespaces)); $this->assertTrue(in_array('VendorName\\Hello\\World', $info->namespaces));