__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* A class for recording the definition of Mink replacements.
*
* @package core
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* A class for recording the definition of Mink replacements for use in Mink selectors.
*
* These are comprised of a source string, and a replacement.
*
* During use the source string is converted from the string to be in the format:
*
* %[component]/[string]%
*
* For example:
*
* %mod_forum/title%
*
* Mink replacements are used in xpath translation to translate regularly used items such as title.
* Here is an example from the upstream Mink project:
*
* '%tagTextMatch%' => 'contains(normalize-space(string(.)), %locator%)'
*
* And can be used in an xpath:
*
* .//label[%tagTextMatch%]
*
* This would be expanded to:
*
* .//label[contains(normalize-space(string(.)), %locator%)]
*
* Replacements can also be used in other replacements, as long as that replacement is defined later.
*
* '%linkMatch%' => '(%idMatch% or %tagTextMatch% or %titleMatch% or %relMatch%)'
*
* @package core
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_component_named_replacement {
/** @var string */
protected $from;
/** @var string */
protected $to;
/**
* Create the replacement.
*
* @param string $from this is the old selector that should no longer be used.
* For example 'group_message'.
* @param string $to this is the new equivalent that should be used instead.
* For example 'core_message > Message'.
*/
public function __construct(string $from, string $to) {
$this->from = $from;
$this->to = $to;
}
/**
* Get the 'from' part of the replacement, formatted for the component.
*
* @param string $component
* @return string
*/
public function get_from(string $component): string {
return "%{$component}/{$this->from}%";
}
/**
* Get the 'to' part of the replacement.
*
* @return string Target xpath
*/
public function get_to(): string {
return $this->to;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| behat_command.php | File | 9.49 KB | 0777 |
|
| behat_config_manager.php | File | 10.06 KB | 0777 |
|
| behat_config_util.php | File | 56.58 KB | 0777 |
|
| behat_context_helper.php | File | 6.24 KB | 0777 |
|
| behat_core_generator.php | File | 47.02 KB | 0777 |
|
| behat_generator_base.php | File | 22.41 KB | 0777 |
|
| behat_selectors.php | File | 4.03 KB | 0777 |
|
| behat_session_interface.php | File | 2.03 KB | 0777 |
|
| behat_session_trait.php | File | 66.1 KB | 0777 |
|
| component_named_replacement.php | File | 2.96 KB | 0777 |
|
| component_named_selector.php | File | 4.42 KB | 0777 |
|
| exact_named_selector.php | File | 2.62 KB | 0777 |
|
| named_selector.php | File | 4.11 KB | 0777 |
|
| partial_named_selector.php | File | 15.71 KB | 0777 |
|
| settable_editor.php | File | 1.2 KB | 0777 |
|
| util.php | File | 18.13 KB | 0777 |
|