-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from pfrenssen/languages
Add support for testing languages
- Loading branch information
Showing
8 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@api @d7 @d8 | ||
Feature: Language support | ||
In order to demonstrate the language integration | ||
As a developer for the Behat Extension | ||
I need to provide test cases for the language support | ||
|
||
# These test scenarios assume to have a clean installation of the "standard" | ||
# profile and that the "behat_test" module from the "fixtures/" folder is | ||
# enabled on the site. | ||
|
||
Scenario: Enable multiple languages | ||
Given the following languages are available: | ||
| languages | | ||
| en | | ||
| fr | | ||
| de | | ||
And I am logged in as a user with the 'administrator' role | ||
When I go to "admin/config/regional/language" | ||
Then I should see "English" | ||
And I should see "French" | ||
And I should see "German" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ package: Test | |
version: '8.x-1.x-dev' | ||
core: '8.x' | ||
project: 'behat_test' | ||
dependencies: | ||
- language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Drupal/DrupalExtension/Hook/Scope/AfterLanguageCreateScope.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Contains \Drupal\DrupalExtension\Hook\Scope\AfterLanguageCreateScope. | ||
*/ | ||
namespace Drupal\DrupalExtension\Hook\Scope; | ||
|
||
/** | ||
* Represents a language hook scope. | ||
*/ | ||
final class AfterLanguageCreateScope extends LanguageScope { | ||
|
||
/** | ||
* Return the scope name. | ||
* | ||
* @return string | ||
*/ | ||
public function getName() { | ||
return self::AFTER; | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/Drupal/DrupalExtension/Hook/Scope/BeforeLanguageCreateScope.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Contains \Drupal\DrupalExtension\Hook\Scope\BeforeLanguageCreateScope. | ||
*/ | ||
namespace Drupal\DrupalExtension\Hook\Scope; | ||
|
||
/** | ||
* Represents a language hook scope. | ||
*/ | ||
final class BeforeLanguageCreateScope extends LanguageScope { | ||
|
||
/** | ||
* Returns the scope name. | ||
* | ||
* @return string | ||
*/ | ||
public function getName() { | ||
return self::BEFORE; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Contains \Drupal\DrupalExtension\Hook\Scope\LanguageScope. | ||
*/ | ||
namespace Drupal\DrupalExtension\Hook\Scope; | ||
|
||
/** | ||
* Represents the LanguageScope object. | ||
*/ | ||
abstract class LanguageScope extends BaseEntityScope { | ||
|
||
const BEFORE = 'language.create.before'; | ||
const AFTER = 'language.create.after'; | ||
|
||
} |