From bda07b1721b39f7bec8fe72f8b83aaaef53124fe Mon Sep 17 00:00:00 2001 From: Davide Iadeluca Date: Tue, 17 Dec 2024 07:55:58 +0100 Subject: [PATCH] test: add reusable traits --- tests/integration/ExtensionDepsTrait.php | 13 ++++++++++++ tests/integration/NotificationsTest.php | 24 +++++++++++++++++++++++ tests/integration/TagsDefinitionTrait.php | 15 ++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 tests/integration/ExtensionDepsTrait.php create mode 100644 tests/integration/NotificationsTest.php create mode 100644 tests/integration/TagsDefinitionTrait.php diff --git a/tests/integration/ExtensionDepsTrait.php b/tests/integration/ExtensionDepsTrait.php new file mode 100644 index 0000000..a071d78 --- /dev/null +++ b/tests/integration/ExtensionDepsTrait.php @@ -0,0 +1,13 @@ +extension('flarum-tags'); + $this->extension('fof-extend'); + $this->extension('fof-follow-tags'); + } +} diff --git a/tests/integration/NotificationsTest.php b/tests/integration/NotificationsTest.php new file mode 100644 index 0000000..908fd07 --- /dev/null +++ b/tests/integration/NotificationsTest.php @@ -0,0 +1,24 @@ +extensionDeps(); + + $this->prepareDatabase([ + 'tags' => $this->tags(), + ]); + } +} diff --git a/tests/integration/TagsDefinitionTrait.php b/tests/integration/TagsDefinitionTrait.php new file mode 100644 index 0000000..ee73951 --- /dev/null +++ b/tests/integration/TagsDefinitionTrait.php @@ -0,0 +1,15 @@ + 1, 'name' => 'General', 'slug' => 'general', 'position' => 0, 'parent_id' => null], + ['id' => 2, 'name' => 'Testing', 'slug' => 'testing', 'position' => 1, 'parent_id' => null], + ['id' => 3, 'name' => 'Archive', 'slug' => 'archive', 'position' => 2, 'parent_id' => null, 'is_restricted' => true], + ]; + } +}