Before Behat, setting filter multilang to active=1 like with local/defaults.php

Before Behat, setting filter multilang to active=1 like with local/defaults.php

by Luca Bösch -
Number of replies: 4
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi, I have a question.

I'm really unsure whether that's possible and how to tackle this.
When behat inits, it builds the site 'Acceptance Test Site', thereby applying the values from local/defaults.php.

Now, I need to set something different, which isn't in the config and config_plugins table: the global settings of a filter.

In adminstration that's under plugins → filters → Manage filters. In the database, that's in the filter_active table: active should be 1 for the row with filter = 'multilang'.

Does anyone have a hint on how to do this?

Best,

Luca

Average of ratings: -
In reply to Luca Bösch

Re: Before Behat, setting filter multilang to active=1 like with local/defaults.php

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Background:
Given the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
In reply to Renaat Debleu

Re: Before Behat, setting filter multilang to active=1 like with local/defaults.php

by Luca Bösch -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
That's in the context of a single Behat test, Renaat.
Thanks anyway.
What I want to acheive is that when a Behat testing site is built (with init.php), then the value should be set for the multilang filter to be on and apply to content and headings.
Do you see what I mean?

Best,
Luca
In reply to Luca Bösch

Re: Before Behat, setting filter multilang to active=1 like with local/defaults.php

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Luca, I don't think you are thinking about this the right way.

Each Behat scenario should be an independent test of some Moodle functionality, starting from a completely new Moodle install, and doing any required setup that it needs.

In fact, I would argue that installing the acceptance testing site should not use local/defaults.php.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Before Behat, setting filter multilang to active=1 like with local/defaults.php

by Luca Bösch -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hhmh, I'm considering changing my mind then.

It's just that with the local/default.php pre-loading of e.g. footer and custom menu (and creating a suite with the theme to have Behat run with) the browser executing the commands really does show a quite 1:1 equivalent on what the Moodle page then really does look like to end users.
It's just that the multilang filters aren't applied, and that hurts a bit, although it is only eye candy (the footer being mainly affected).

This is to illustrate the point of view I was starting, so you may also see that part.
But, as said, I value your point as well, and now I'm a bit torn apart.

But do not worry.

Best,
Luca