Skip to content

Add extension lang files to extension functional test case#11

Merged
EXreaction merged 2 commits intophpbb-extensions:masterfrom
iMattPro:feature-add-lang
Mar 14, 2014
Merged

Add extension lang files to extension functional test case#11
EXreaction merged 2 commits intophpbb-extensions:masterfrom
iMattPro:feature-add-lang

Conversation

@iMattPro
Copy link
Copy Markdown
Contributor

@iMattPro iMattPro commented Mar 8, 2014

This should allow extensions to load their own lang files in functional testing, and use this->lang() instead of hardcoding language into their tests, e.g.:

$this->add_lang_ext(array('boardrules_common', 'boardrules_controller');

$this->assertContains($this->lang('BOARDRULES_HEADER'), $crawler->text());
$this->assertContains($this->lang('BOARDRULES'), $crawler->text());

This is based off the add_lang() function from the phpbb_functional_test_case

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should return after this or you'll have an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually doesn't error :)

In the case of passing along an array, lang_path simply won't exist, so no include will be attempted, and an empty array would be merged in to the existing filled lang array.

This is an exact copy of the add_lang() function used in the main phpbb functional test case, only difference being the $lang_path here points to the extension's language files instead of phpBB's language files.

EXreaction added a commit that referenced this pull request Mar 14, 2014
Add extension lang files to extension functional test case
@EXreaction EXreaction merged commit d3186af into phpbb-extensions:master Mar 14, 2014
@iMattPro iMattPro deleted the feature-add-lang branch March 14, 2014 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants