Вход Регистрация
Файл: gapps/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php
Строк: 57
<?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 SymfonyComponentCssSelectorTestsNode;

use 
SymfonyComponentCssSelectorNodeSpecificity;

class 
SpecificityTest extends PHPUnit_Framework_TestCase
{
    
/** @dataProvider getValueTestData */
    
public function testValue(Specificity $specificity$value)
    {
        
$this->assertEquals($value$specificity->getValue());
    }

    
/** @dataProvider getValueTestData */
    
public function testPlusValue(Specificity $specificity$value)
    {
        
$this->assertEquals($value 123$specificity->plus(new Specificity(123))->getValue());
    }

    public function 
getValueTestData()
    {
        return array(
            array(new 
Specificity(000), 0),
            array(new 
Specificity(002), 2),
            array(new 
Specificity(030), 30),
            array(new 
Specificity(400), 400),
            array(new 
Specificity(432), 432),
        );
    }

    
/** @dataProvider getCompareTestData */
    
public function testCompareTo(Specificity $aSpecificity $b$result)
    {
        
$this->assertEquals($result$a->compareTo($b));
    }

    public function 
getCompareTestData()
    {
        return array(
            array(new 
Specificity(000), new Specificity(000), 0),
            array(new 
Specificity(001), new Specificity(001), 0),
            array(new 
Specificity(002), new Specificity(001), 1),
            array(new 
Specificity(002), new Specificity(003), -1),
            array(new 
Specificity(040), new Specificity(040), 0),
            array(new 
Specificity(060), new Specificity(0511), 1),
            array(new 
Specificity(070), new Specificity(080), -1),
            array(new 
Specificity(900), new Specificity(900), 0),
            array(new 
Specificity(1100), new Specificity(10110), 1),
            array(new 
Specificity(12110), new Specificity(1300), -1),
        );
    }
}
Онлайн: 2
Реклама