From 31f5684cd11bbf03b10a729a4ccdfcc84ec14159 Mon Sep 17 00:00:00 2001 From: Renaat Debleu Date: Tue, 9 Apr 2024 15:39:36 +0000 Subject: [PATCH] behat order --- .github/workflows/cron.yml | 4 ---- .github/workflows/main.yml | 4 ---- tests/behat/behat_repository_s3bucket.php | 8 ++++---- tests/behat/s3bucket_global.feature | 16 ++++++++-------- ...t_course.feature => s3bucket_ucourse.feature} | 0 version.php | 2 +- 6 files changed, 13 insertions(+), 21 deletions(-) rename tests/behat/{s3bucket_course.feature => s3bucket_ucourse.feature} (100%) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index ae4a43b..b92d12e 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -54,10 +54,6 @@ jobs: if: ${{ !cancelled() }} run: moodle-plugin-ci --ansi phplint - - name: phpcpd - if: ${{ !cancelled() }} - run: moodle-plugin-ci --ansi phpcpd - - name: phpmd if: ${{ !cancelled() }} run: moodle-plugin-ci --ansi phpmd diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01bd3c6..731ca75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,10 +74,6 @@ jobs: if: ${{ !cancelled() }} run: moodle-plugin-ci --ansi phplint - - name: phpcpd - if: ${{ !cancelled() }} - run: moodle-plugin-ci --ansi phpcpd - - name: phpmd if: ${{ !cancelled() }} run: moodle-plugin-ci --ansi phpmd diff --git a/tests/behat/behat_repository_s3bucket.php b/tests/behat/behat_repository_s3bucket.php index 38a4b43..4f7f267 100644 --- a/tests/behat/behat_repository_s3bucket.php +++ b/tests/behat/behat_repository_s3bucket.php @@ -42,9 +42,9 @@ class behat_repository_s3bucket extends behat_base { * @throws dml_exception */ public function i_enable_repository($repository) { - global $DB; - if (!$DB->record_exists('repository', ['type' => $repository])) { - $DB->insert_record('repository', (object) ['type' => $repository, 'visible' => 1]); - } + global $CFG; + require_once($CFG->dirroot . '/repository/lib.php'); + $s3bucketplugin = new repository_type($repository, [], true); + $s3bucketplugin->create(true); } } diff --git a/tests/behat/s3bucket_global.feature b/tests/behat/s3bucket_global.feature index 664703b..3583112 100644 --- a/tests/behat/s3bucket_global.feature +++ b/tests/behat/s3bucket_global.feature @@ -3,16 +3,16 @@ Feature: S3 bucket global repositories should be seen by admins and teachers Background: Given the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | + | fullname | shortname | + | Course 1 | C1 | And the following "users" exist: - | username | email | firstname | lastname | - | student | s@example.com | Student | 1 | - | teacher | t@example.com | Teacher | 1 | + | username | + | student | + | teacher | And the following "course enrolments" exist: - | user | course | role | - | student | C1 | student | - | teacher | C1 | editingteacher | + | user | course | role | + | student | C1 | student | + | teacher | C1 | editingteacher | And the following "activities" exist: | activity | name | course | idnumber | section | | url | UrlA | C1 | urlA | 1 | diff --git a/tests/behat/s3bucket_course.feature b/tests/behat/s3bucket_ucourse.feature similarity index 100% rename from tests/behat/s3bucket_course.feature rename to tests/behat/s3bucket_ucourse.feature diff --git a/version.php b/version.php index 40f7b2a..67df0e9 100644 --- a/version.php +++ b/version.php @@ -29,5 +29,5 @@ $plugin->maturity = MATURITY_STABLE; $plugin->dependencies = ['repository_s3' => ANY_VERSION, 'local_aws' => 2023042400]; $plugin->release = 'v4.2.3'; -$plugin->supported = [402, 403]; +$plugin->supported = [402, 404]; $plugin->version = 2024031000;