File tree Expand file tree Collapse file tree 7 files changed +55
-8
lines changed
Expand file tree Collapse file tree 7 files changed +55
-8
lines changed Original file line number Diff line number Diff line change 11language : php
22
3+ sudo : required
4+ dist : trusty
5+ group : edge
6+
37php :
4- - 5.6
58 - 7.0
6- - 7.0snapshot
79 - 7.1
810 - 7.1snapshot
11+ - 7.2
12+ - 7.2snapshot
913 - nightly
1014
1115matrix :
@@ -15,12 +19,11 @@ matrix:
1519before_install :
1620 - composer self-update
1721 - composer clear-cache
18- - if [ $(phpenv version-name) = "5.6" ]; then wget https://phar.phpunit.de/phpunit-5.7.phar -O phpunit.phar; fi
19- - if [ $(phpenv version-name) != "5.6" ]; then wget https://phar.phpunit.de/phpunit.phar; fi
22+ - wget -O phpunit.phar https://phar.phpunit.de/phpunit-6.phar
2023
2124install : composer install
2225
23- script : php phpunit.phar --configuration phpunit.xml.dist
26+ script : php phpunit.phar tests
2427
2528notifications :
2629 webhooks :
Original file line number Diff line number Diff line change 77[ ![ Latest Unstable Version] ( https://poser.pugx.org/carica/phpcss/v/unstable.svg )] ( https://packagist.org/packages/carica/phpcss )
88
99* License: The MIT License
10- * Copyright: 2010-2014 PhpCss Team
10+ * Copyright: 2010-2018 PhpCss Team
1111* Author: [ Thomas Weinert] ( http://thomas.weinert.info ) < thomas@weinert.info >
1212
1313Thanks to Benjamin Eberlei, Bastian Feder and Jakob Westhoff for ideas and concepts.
Original file line number Diff line number Diff line change 1111 ],
1212 "config" : {
1313 "platform" : {
14- "php" : " 5.6 "
14+ "php" : " 7.0 "
1515 }
1616 },
1717 "require" : {
18- "PHP" : " >=5.5 "
18+ "PHP" : " >=7.0 "
1919 },
2020 "autoload" : {
2121 "psr-4" : {"PhpCss\\ " : " src/PhpCss" },
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phive xmlns =" https://phar.io/phive" >
3+ <phar name =" phpunit" version =" 6" installed =" 6.5.7" location =" ./tools/phpunit" />
4+ </phive >
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ class Xpath extends Overload {
4343 * start expressions in descendant-or-self context
4444 */
4545 const OPTION_USE_CONTEXT_SELF = 32 ;
46+ /**
47+ * limit expressions to self context
48+ */
49+ const OPTION_USE_CONTEXT_SELF_LIMIT = 64 ;
50+
4651 /**
4752 * lowercase the element names (not the namespace prefixes)
4853 */
@@ -288,6 +293,8 @@ public function visitEnterSelectorSequence(Ast\Selector\Sequence $sequence) {
288293 }
289294 if ($ this ->hasOption (self ::OPTION_USE_CONTEXT_DOCUMENT )) {
290295 $ this ->add ('// ' );
296+ } elseif ($ this ->hasOption (self ::OPTION_USE_CONTEXT_SELF_LIMIT )) {
297+ $ this ->add ('self:: ' );
291298 } elseif ($ this ->hasOption (self ::OPTION_USE_CONTEXT_SELF )) {
292299 $ this ->add ('descendant-or-self:: ' );
293300 } else {
Original file line number Diff line number Diff line change @@ -133,6 +133,17 @@ public static function provideExamples() {
133133 ),
134134 Ast \Visitor \Xpath::OPTION_USE_CONTEXT_SELF
135135 ),
136+ 'element, self context limit ' => array (
137+ 'self::*[local-name() = "element"] ' ,
138+ new Ast \Selector \Group (
139+ array (
140+ new Ast \Selector \Sequence (
141+ array (new Ast \Selector \Simple \Type ('element ' ))
142+ )
143+ )
144+ ),
145+ Ast \Visitor \Xpath::OPTION_USE_CONTEXT_SELF_LIMIT
146+ ),
136147 'element, #id ' => array (
137148 './/*[local-name() = "element"]|.//*[@id = "id"] ' ,
138149 new Ast \Selector \Group (
You can’t perform that action at this time.
0 commit comments