Skip to content

Commit

Permalink
style: use phpcbf to auto-fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MHajoha committed Jul 30, 2024
1 parent b4f64db commit 52850ce
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion tests/external/favourite_package_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @copyright 2024 TU Berlin, innoCampus {@link https://www.questionpy.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class favourite_package_test extends \externallib_advanced_testcase {
final class favourite_package_test extends \externallib_advanced_testcase {
/**
* This method is called before each test.
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/external/get_tags_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @copyright 2024 TU Berlin, innoCampus {@link https://www.questionpy.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class get_tags_test extends \externallib_advanced_testcase {
final class get_tags_test extends \externallib_advanced_testcase {
/**
* Test that the user needs to be logged in.
*
Expand Down
4 changes: 2 additions & 2 deletions tests/external/search_packages_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @copyright 2023 TU Berlin, innoCampus {@link https://www.questionpy.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class search_packages_test extends \externallib_advanced_testcase {
final class search_packages_test extends \externallib_advanced_testcase {
/**
* This method is called before each test.
*/
Expand Down Expand Up @@ -839,7 +839,7 @@ public function test_favourites_are_not_shared_across_users(): void {
* @return void
* @throws moodle_exception
*/
public function test_search_with_tags() {
public function test_search_with_tags(): void {
global $DB;

package_provider(['namespace' => 'ns1', 'tags' => ['a']])->store();
Expand Down
2 changes: 1 addition & 1 deletion tests/form/elements/element_html_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @copyright 2022 TU Berlin, innoCampus {@link https://www.questionpy.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class element_html_test extends \advanced_testcase {
final class element_html_test extends \advanced_testcase {
/**
* Implements a snapshot testing approach similar to that of {@link https://jestjs.io/docs/snapshot-testing Jest}.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/form/elements/element_json_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @copyright 2022 TU Berlin, innoCampus {@link https://www.questionpy.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class element_json_test extends \advanced_testcase {
final class element_json_test extends \advanced_testcase {
/**
* Serializes values and compares resulting JSON to an expected file.
*
Expand Down
4 changes: 2 additions & 2 deletions tests/http_response_container_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @copyright 2022 Jan Britz, TU Berlin, innoCampus - www.questionpy.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class http_response_container_test extends \advanced_testcase {
final class http_response_container_test extends \advanced_testcase {
/**
* Tests the function get_data with json.
*
Expand Down Expand Up @@ -59,7 +59,7 @@ public function test_get_data_with_json(): void {
* @return void
* @throws moodle_exception
*/
public function test_get_data_not_json() {
public function test_get_data_not_json(): void {
$code = 200;
$data = 'This is not a json.';

Expand Down
16 changes: 8 additions & 8 deletions tests/last_used_service_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
* @copyright 2024 Jan Britz, TU Berlin, innoCampus - www.questionpy.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class last_used_service_test extends \advanced_testcase {
final class last_used_service_test extends \advanced_testcase {
/**
* Tests {@see last_used_service::add()} create correct timestamp.
*
* @throws moodle_exception
* @covers \qtype_questionpy\last_used_service::add
*/
public function test_add_creates_entry() {
public function test_add_creates_entry(): void {
global $DB;
$this->resetAfterTest();

Expand All @@ -53,7 +53,7 @@ public function test_add_creates_entry() {
* @throws moodle_exception
* @covers \qtype_questionpy\last_used_service::add
*/
public function test_add_updates_timestamp_if_package_was_already_used() {
public function test_add_updates_timestamp_if_package_was_already_used(): void {
global $DB;
$this->resetAfterTest();

Expand Down Expand Up @@ -81,7 +81,7 @@ public function test_add_updates_timestamp_if_package_was_already_used() {
* @throws moodle_exception
* @covers \qtype_questionpy\last_used_service::add
*/
public function test_add_inserts_entries_if_packages_differ() {
public function test_add_inserts_entries_if_packages_differ(): void {
global $DB;
$this->resetAfterTest();

Expand All @@ -107,7 +107,7 @@ public function test_add_inserts_entries_if_packages_differ() {
* @throws moodle_exception
* @covers \qtype_questionpy\last_used_service::add
*/
public function test_add_inserts_entries_if_contexts_differ() {
public function test_add_inserts_entries_if_contexts_differ(): void {
global $DB;
$this->resetAfterTest();

Expand All @@ -133,7 +133,7 @@ public function test_add_inserts_entries_if_contexts_differ() {
* @throws moodle_exception
* @covers \qtype_questionpy\last_used_service::add
*/
public function test_add_inserts_entries_if_packages_and_contexts_differ() {
public function test_add_inserts_entries_if_packages_and_contexts_differ(): void {
global $DB;
$this->resetAfterTest();

Expand Down Expand Up @@ -175,7 +175,7 @@ public static function context_count_provider(): array {
* @dataProvider context_count_provider
* @covers \qtype_questionpy\last_used_service::remove_by_package
*/
public function test_remove_by_package_removes_the_entries(int $contexts) {
public function test_remove_by_package_removes_the_entries(int $contexts): void {
global $DB;
$this->resetAfterTest();

Expand All @@ -197,7 +197,7 @@ public function test_remove_by_package_removes_the_entries(int $contexts) {
* @throws moodle_exception
* @covers \qtype_questionpy\last_used_service::remove_by_package
*/
public function test_remove_by_package_only_removes_the_given_package() {
public function test_remove_by_package_only_removes_the_given_package(): void {
global $DB;
$this->resetAfterTest();

Expand Down
2 changes: 1 addition & 1 deletion tests/localizer_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @copyright 2022 Jan Britz, TU Berlin, innoCampus - www.questionpy.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class localizer_test extends \advanced_testcase {
final class localizer_test extends \advanced_testcase {
/**
* Test the default of the function get_preferred_language.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/package/package_base_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @copyright 2023 Jan Britz, TU Berlin, innoCampus - www.questionpy.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class package_base_test extends \advanced_testcase {
final class package_base_test extends \advanced_testcase {
/**
* Tests the method get_localized_name.
*
Expand Down
12 changes: 6 additions & 6 deletions tests/package/package_raw_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @copyright 2023 Jan Britz, TU Berlin, innoCampus - www.questionpy.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class package_raw_test extends \advanced_testcase {
final class package_raw_test extends \advanced_testcase {
/**
* Provides valid package data.
*
Expand Down Expand Up @@ -138,7 +138,7 @@ public function test_from_array($packagedata): void {
* @return void
* @throws moodle_exception
*/
public function test_faulty_from_array() {
public function test_faulty_from_array(): void {
$this->expectException(moodle_exception::class);
$faulty = ['faulty' => 'hash'];
array_converter::from_array(package_raw::class, $faulty);
Expand All @@ -154,7 +154,7 @@ public function test_faulty_from_array() {
* @return void
* @throws moodle_exception
*/
public function test_store_package($packagedata) {
public function test_store_package($packagedata): void {
global $DB;
$this->resetAfterTest();

Expand Down Expand Up @@ -219,7 +219,7 @@ public function test_store_package($packagedata) {
* @return void
* @throws moodle_exception
*/
public function test_store_package_twice() {
public function test_store_package_twice(): void {
global $DB;
$this->resetAfterTest();

Expand All @@ -241,7 +241,7 @@ public function test_store_package_twice() {
* @return void
* @throws moodle_exception
*/
public function test_store_already_existing_package_with_different_hash_throws() {
public function test_store_already_existing_package_with_different_hash_throws(): void {
$this->resetAfterTest();
$this->expectException(moodle_exception::class);
$this->expectExceptionMessage('A package with the same version but different hash already exists.');
Expand All @@ -261,7 +261,7 @@ public function test_store_already_existing_package_with_different_hash_throws()
* @return void
* @throws moodle_exception
*/
public function test_store_different_versions_of_a_package() {
public function test_store_different_versions_of_a_package(): void {
global $DB;
$this->resetAfterTest();

Expand Down
12 changes: 6 additions & 6 deletions tests/package/package_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
* @copyright 2022 Jan Britz, TU Berlin, innoCampus - www.questionpy.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class package_test extends \advanced_testcase {
final class package_test extends \advanced_testcase {
/**
* Tests the method get_by_version.
*
* @covers \package::get_by_version
* @return void
* @throws moodle_exception
*/
public function test_get_by_version() {
public function test_get_by_version(): void {
$this->resetAfterTest();

// Store a package.
Expand Down Expand Up @@ -79,7 +79,7 @@ private function assert_records_count(int $pkgversion, int $package, int $langua
* @return void
* @throws moodle_exception
*/
public function test_delete() {
public function test_delete(): void {
$this->resetAfterTest();

// Store a package.
Expand All @@ -99,7 +99,7 @@ public function test_delete() {
* @return void
* @throws moodle_exception
*/
public function test_delete_with_multiple_versions() {
public function test_delete_with_multiple_versions(): void {
$this->resetAfterTest();

// Store two versions of the same package.
Expand All @@ -120,7 +120,7 @@ public function test_delete_with_multiple_versions() {
* @return void
* @throws moodle_exception
*/
public function test_delete_with_multiple_packages() {
public function test_delete_with_multiple_packages(): void {
$this->resetAfterTest();

// Store two packages.
Expand All @@ -144,7 +144,7 @@ public function test_delete_with_multiple_packages() {
* @covers \qtype_questionpy\package::equals
* @return void
*/
public function test_difference_from() {
public function test_difference_from(): void {
$package1 = new package(0, 'shortname', 'namespace', [], 'type', 'author', 'url', ['en', 'de']);
$package2 = new package(1, 'shortname', 'namespace', [], 'type', 'author', 'url', ['de', 'en']);

Expand Down
10 changes: 5 additions & 5 deletions tests/package/package_version_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
* @copyright 2023 Jan Britz, TU Berlin, innoCampus - www.questionpy.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class package_version_test extends \advanced_testcase {
final class package_version_test extends \advanced_testcase {
/**
* Tests the get_by_id method.
*
* @covers \package_version::get_by_id
* @throws moodle_exception
*/
public function test_get_by_id() {
public function test_get_by_id(): void {
$this->resetAfterTest();

// Store a package.
Expand All @@ -59,7 +59,7 @@ public function test_get_by_id() {
* @depends test_get_by_id
* @throws moodle_exception
*/
public function test_get_by_hash() {
public function test_get_by_hash(): void {
$this->resetAfterTest();

// Store a package.
Expand All @@ -80,7 +80,7 @@ public function test_get_by_hash() {
* @depends test_get_by_id
* @throws moodle_exception
*/
public function test_delete() {
public function test_delete(): void {
global $DB;
$this->resetAfterTest();

Expand All @@ -105,7 +105,7 @@ public function test_delete() {
* @depends test_get_by_id
* @throws moodle_exception
*/
public function test_delete_where_multiple_versions_exist() {
public function test_delete_where_multiple_versions_exist(): void {
global $DB;
$this->resetAfterTest();

Expand Down
Loading

0 comments on commit 52850ce

Please sign in to comment.