aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2019-05-08 01:47:19 +0300
committerValentin Popov <info@valentineus.link>2019-05-08 01:47:19 +0300
commit8bf6ed81223678bd459e66b85af21b446853ef68 (patch)
treee4a8a7082e07bb01d702f6a08c77ad78f5a5c9ef /tests
parente2627eaf86a6fa9ee13681d729c5ec1b53610971 (diff)
downloadlocal_webhooks-8bf6ed81223678bd459e66b85af21b446853ef68.tar.xz
local_webhooks-8bf6ed81223678bd459e66b85af21b446853ef68.zip
Added function get an event's list
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'tests')
-rw-r--r--tests/api_test.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/api_test.php b/tests/api_test.php
index 941fdbd..f68ae52 100644
--- a/tests/api_test.php
+++ b/tests/api_test.php
@@ -111,8 +111,33 @@ final class local_webhooks_api_testcase extends advanced_testcase {
}
/**
+ * Testing get an event's list.
+ *
+ * @group local_webhooks
+ *
+ * @throws \ReflectionException
+ */
+ public function test_get_events() {
+ $this->resetAfterTest();
+
+ $events = api::get_events();
+
+ self::assertNotCount(0, $events);
+
+ foreach ($events as $name => $event) {
+ self::assertInternalType('array', $event);
+
+ self::assertEquals([
+ 'eventname', 'component', 'target', 'action', 'crud', 'edulevel', 'objecttable',
+ ], array_keys($event));
+ }
+ }
+
+ /**
* Testing get to a service.
*
+ * @group local_webhooks
+ *
* @throws \dml_exception
* @throws \moodle_exception
*/
@@ -152,6 +177,8 @@ final class local_webhooks_api_testcase extends advanced_testcase {
/**
* Testing get to the list services.
*
+ * @group local_webhooks
+ *
* @throws \dml_exception
* @throws \moodle_exception
*/
@@ -199,6 +226,8 @@ final class local_webhooks_api_testcase extends advanced_testcase {
/**
* Testing get to the list services by event name.
*
+ * @group local_webhooks
+ *
* @throws \dml_exception
* @throws \moodle_exception
*/
@@ -236,6 +265,8 @@ final class local_webhooks_api_testcase extends advanced_testcase {
/**
* Testing get to the list services with conditions.
*
+ * @group local_webhooks
+ *
* @throws \dml_exception
* @throws \moodle_exception
*/