ExactNamedSelector.php 975 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /*
  3. * This file is part of the Mink package.
  4. * (c) Konstantin Kudryashov <ever.zet@gmail.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. namespace Behat\Mink\Selector;
  10. /**
  11. * Exact match selector engine. Like the Named selector engine but ignores partial matches.
  12. */
  13. class ExactNamedSelector extends NamedSelector
  14. {
  15. public function __construct()
  16. {
  17. $this->registerReplacement('%tagTextMatch%', 'normalize-space(string(.)) = %locator%');
  18. $this->registerReplacement('%valueMatch%', './@value = %locator%');
  19. $this->registerReplacement('%titleMatch%', './@title = %locator%');
  20. $this->registerReplacement('%altMatch%', './@alt = %locator%');
  21. $this->registerReplacement('%relMatch%', './@rel = %locator%');
  22. $this->registerReplacement('%labelAttributeMatch%', './@label = %locator%');
  23. parent::__construct();
  24. }
  25. }