Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions tests/behat/download_qrcode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ Feature: Download QR code as .png file
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | Crs1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "QR code" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| qrcode | Course | Crs1 | course-view-* | site-post |

@javascript
Scenario: Teacher sees the QR code and clicks on the Download button
Expand Down
7 changes: 3 additions & 4 deletions tests/behat/show_qrcode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ Feature: Display the QR code block
| user | course | role |
| teacher1 | Crs1 | editingteacher |
| student1 | Crs1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "QR code" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| qrcode | Course | Crs1 | course-view-* | site-post |

@javascript
Scenario: Only enrolled students are able to see the QR code and they don't see the download button
Expand Down
47 changes: 47 additions & 0 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="lib/phpunit/phpunit.xsd"
bootstrap="lib/phpunit/bootstrap.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
backupGlobals="false"
backupStaticAttributes="false"
cacheResult="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
beStrictAboutTestsThatDoNotTestAnything="false"
beStrictAboutOutputDuringTests="true"
>

<php>
<!--<const name="PHPUNIT_LONGTEST" value="1"/> uncomment to execute also slow or otherwise expensive tests-->
<const name="PHPUNIT_SEQUENCE_START" value="195000"/>

<!--Following constants instruct tests to fetch external test files from alternative location
or skip tests if empty, clone https://github.com/moodlehq/moodle-exttests to local web server-->
<!--<const name="TEST_EXTERNAL_FILES_HTTP_URL" value="http://download.moodle.org/unittest"/>
uncomment and alter to fetch external test files from alternative location-->
<!--<const name="TEST_EXTERNAL_FILES_HTTPS_URL" value="https://download.moodle.org/unittest"/>
uncomment and alter to fetch external test files from alternative location-->
</php>

<testsuites>
<testsuite name="block_qrcode_testsuite">
<directory suffix="_test.php">blocks/qrcode/tests</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true"
restrictNotices="true"
restrictWarnings="true">
<include>
<directory>blocks/qrcode/thirdparty</directory>
<directory>thirdparty</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
$plugin->component = 'block_qrcode'; // Full name of the plugin.
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'v4.5-r1';
$plugin->version = 2025022400; // The current plugin version (Date: YYYMMDDXX).
$plugin->version = 2025062400; // The current plugin version (Date: YYYMMDDXX).
$plugin->requires = 2022112800; // Requires Moodle 4.1+.
Loading