1<?php 2 3/* 4 * This file is part of the Symfony package. 5 * 6 * (c) Fabien Potencier <fabien@symfony.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace Symfony\Component\CssSelector\Tests\Node; 13 14use Symfony\Component\CssSelector\Node\ElementNode; 15use Symfony\Component\CssSelector\Node\FunctionNode; 16use Symfony\Component\CssSelector\Parser\Token; 17 18class FunctionNodeTest extends AbstractNodeTest 19{ 20 public function getToStringConversionTestData() 21 { 22 return [ 23 [new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'], 24 [new FunctionNode(new ElementNode(), 'function', [ 25 new Token(Token::TYPE_IDENTIFIER, 'value', 0), 26 ]), "Function[Element[*]:function(['value'])]"], 27 [new FunctionNode(new ElementNode(), 'function', [ 28 new Token(Token::TYPE_STRING, 'value1', 0), 29 new Token(Token::TYPE_NUMBER, 'value2', 0), 30 ]), "Function[Element[*]:function(['value1', 'value2'])]"], 31 ]; 32 } 33 34 public function getSpecificityValueTestData() 35 { 36 return [ 37 [new FunctionNode(new ElementNode(), 'function'), 10], 38 [new FunctionNode(new ElementNode(), 'function', [ 39 new Token(Token::TYPE_IDENTIFIER, 'value', 0), 40 ]), 10], 41 [new FunctionNode(new ElementNode(), 'function', [ 42 new Token(Token::TYPE_STRING, 'value1', 0), 43 new Token(Token::TYPE_NUMBER, 'value2', 0), 44 ]), 10], 45 ]; 46 } 47} 48