4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Intl\Tests\Collator
;
14 use Symfony\Component\Intl\Collator\Collator
;
15 use Symfony\Component\Intl\Locale
;
18 * Test case for Collator implementations.
20 * @author Bernhard Schussek <bschussek@gmail.com>
22 abstract class AbstractCollatorTest
extends \PHPUnit_Framework_TestCase
25 * @dataProvider asortProvider
27 public function testAsort($array, $sortFlag, $expected)
29 $collator = $this->getCollator('en');
30 $collator->asort($array, $sortFlag);
31 $this->assertSame($expected, $array);
34 public function asortProvider()
37 /* array, sortFlag, expected */
40 Collator
::SORT_REGULAR
,
45 Collator
::SORT_REGULAR
,
46 array(2 => 'a', 1 => 'b', 0 => 'c'),
50 Collator
::SORT_REGULAR
,
51 array(2 => 'a', 0 => 'b', 1 => 'c'),
57 * @param string $locale
61 abstract protected function getCollator($locale);