Skip to content

Commit

Permalink
fix typo, remove todo, update README.md, fix too strict error message…
Browse files Browse the repository at this point in the history
… validation in test
  • Loading branch information
Glutamat42 committed Dec 16, 2024
1 parent 1d49b32 commit 4582e3d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Declarative setup #

TODO Describe the plugin shortly here.
Allows to configure moodle in a declarative way, similar to Ansible.

TODO Provide more detailed description here.
## Usage ##
`config.php` has to be writeable for some plays to work.

# Requirements (TODO)
- Allow providing GitHub authentication
See [Playbook README.md](playbook/README.md) for more information on how to use this plugin.

## Installing via uploaded ZIP file ##

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

namespace local_declarativesetup\local\play\install_plugins\models;

// TODO: do this refactoring for all models. also update docs
use invalid_parameter_exception;

class install_plugins_model {
/**
* @param string $version The release version or branch of the plugin to install (e.g. "1.0.0" or "main")
Expand Down
4 changes: 2 additions & 2 deletions classes/local/play/user/models/user_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class user_model {
* @param bool $present true: user should be present (create/update), false: user should be absent (delete)
* @param array $system_roles
* @param bool $append_roles if true, roles will be added to existing roles, if false, existing roles will be replaced
* @param string $langauge
* @param string $language
* @param string|null $firstname
* @param string|null $lastname
* @param string|null $email
Expand All @@ -25,7 +25,7 @@ public function __construct(public string $username,
public bool $present = true,
public array $system_roles = [],
public bool $append_roles = true,
public string $langauge = 'en',
public string $language = 'en',
string|null $firstname = null,
string|null $lastname = null,
string|null $email = null,
Expand Down
4 changes: 2 additions & 2 deletions tests/local/base_playbook_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function test_get_environment_variable_not_prefixed_correctly() {
$method->setAccessible(true);

$this->expectException(Exception::class);
$this->expectExceptionMessage('Environment variable TEST_VAR not set');
$this->expectExceptionMessageMatches('/TEST_VAR not set/');

$method->invoke($playbook, 'TEST_VAR');

Expand All @@ -90,7 +90,7 @@ public function test_get_environment_variable_does_not_exist() {
$method->setAccessible(true);

$this->expectException(Exception::class);
$this->expectExceptionMessage('Environment variable NON_EXISTENT_VAR not set');
$this->expectExceptionMessageMatches('/NON_EXISTENT_VAR not set/');

$method->invoke($playbook, 'NON_EXISTENT_VAR');
}
Expand Down

0 comments on commit 4582e3d

Please sign in to comment.