Вход Регистрация
Файл: symfony-2.7/src/Symfony/Component/Intl/Tests/Collator/CollatorTest.php
Строк: 133
<?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 SymfonyComponentIntlTestsCollator;

use 
SymfonyComponentIntlCollatorCollator;
use 
SymfonyComponentIntlGlobalsIntlGlobals;

class 
CollatorTest extends AbstractCollatorTest
{
    
/**
     * @expectedException SymfonyComponentIntlExceptionMethodArgumentValueNotImplementedException
     */
    
public function testConstructorWithUnsupportedLocale()
    {
        new 
Collator('pt_BR');
    }

    
/**
     * @expectedException SymfonyComponentIntlExceptionMethodNotImplementedException
     */
    
public function testCompare()
    {
        
$collator $this->getCollator('en');
        
$collator->compare('a''b');
    }

    
/**
     * @expectedException SymfonyComponentIntlExceptionMethodNotImplementedException
     */
    
public function testGetAttribute()
    {
        
$collator $this->getCollator('en');
        
$collator->getAttribute(Collator::NUMERIC_COLLATION);
    }

    public function 
testGetErrorCode()
    {
        
$collator $this->getCollator('en');
        
$this->assertEquals(IntlGlobals::U_ZERO_ERROR$collator->getErrorCode());
    }

    public function 
testGetErrorMessage()
    {
        
$collator $this->getCollator('en');
        
$this->assertEquals('U_ZERO_ERROR'$collator->getErrorMessage());
    }

    public function 
testGetLocale()
    {
        
$collator $this->getCollator('en');
        
$this->assertEquals('en'$collator->getLocale());
    }

    
/**
     * @expectedException SymfonyComponentIntlExceptionMethodNotImplementedException
     */
    
public function testGetSortKey()
    {
        
$collator $this->getCollator('en');
        
$collator->getSortKey('Hello');
    }

    
/**
     * @expectedException SymfonyComponentIntlExceptionMethodNotImplementedException
     */
    
public function testGetStrength()
    {
        
$collator $this->getCollator('en');
        
$collator->getStrength();
    }

    
/**
     * @expectedException SymfonyComponentIntlExceptionMethodNotImplementedException
     */
    
public function testSetAttribute()
    {
        
$collator $this->getCollator('en');
        
$collator->setAttribute(Collator::NUMERIC_COLLATIONCollator::ON);
    }

    
/**
     * @expectedException SymfonyComponentIntlExceptionMethodNotImplementedException
     */
    
public function testSetStrength()
    {
        
$collator $this->getCollator('en');
        
$collator->setStrength(Collator::PRIMARY);
    }

    public function 
testStaticCreate()
    {
        
$collator Collator::create('en');
        
$this->assertInstanceOf('SymfonyComponentIntlCollatorCollator'$collator);
    }

    protected function 
getCollator($locale)
    {
        return new 
Collator($locale);
    }
}
Онлайн: 1
Реклама