Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated parsers to support namespaces (fix for ClassParser included)
- Loading branch information
1 parent
a7c9863
commit 3c015d5
Showing
8 changed files
with
83 additions
and
16 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
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
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
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
35 changes: 35 additions & 0 deletions
35
src/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.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,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut; | ||
|
||
use Symfony\Component\CssSelector\Node\SelectorNode; | ||
use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; | ||
|
||
/** | ||
* @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> | ||
*/ | ||
class EmptyStringParserTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testParse() | ||
{ | ||
$parser = new EmptyStringParser(); | ||
$selectors = $parser->parse(''); | ||
$this->assertEquals(1, count($selectors)); | ||
|
||
/** @var SelectorNode $selector */ | ||
$selector = $selectors[0]; | ||
$this->assertEquals('Element[*]', (string) $selector->getTree()); | ||
|
||
$selectors = $parser->parse('this will produce an empty array'); | ||
$this->assertEquals(0, count($selectors)); | ||
} | ||
} |
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