* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Tests\Collator; use Symfony\Component\Intl\Collator\Collator; use Symfony\Component\Intl\Globals\IntlGlobals; class CollatorTest extends AbstractCollatorTest { /** * @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException */ public function testConstructorWithUnsupportedLocale() { new Collator('pt_BR'); } /** * @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException */ public function testCompare() { $collator = $this->getCollator('en'); $collator->compare('a', 'b'); } /** * @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException */ 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()); } public function testConstructWithoutLocale() { $collator = $this->getCollator(null); $this->assertInstanceOf('\Symfony\Component\Intl\Collator\Collator', $collator); } /** * @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException */ public function testGetSortKey() { $collator = $this->getCollator('en'); $collator->getSortKey('Hello'); } /** * @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException */ public function testGetStrength() { $collator = $this->getCollator('en'); $collator->getStrength(); } /** * @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException */ public function testSetAttribute() { $collator = $this->getCollator('en'); $collator->setAttribute(Collator::NUMERIC_COLLATION, Collator::ON); } /** * @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException */ public function testSetStrength() { $collator = $this->getCollator('en'); $collator->setStrength(Collator::PRIMARY); } public function testStaticCreate() { $collator = Collator::create('en'); $this->assertInstanceOf('\Symfony\Component\Intl\Collator\Collator', $collator); } protected function getCollator($locale) { return new Collator($locale); } } __halt_compiler();----SIGNATURE:----BbWKD/2Taqudu9QN7DVGuG3hG/W53qRnpSSOIbCbeSjPFcsCvSTezGx3CS8V15kuw5uY6qZEq+OQchSSZx9znSXC2MP6TY9lO8PV9KtiiRSK1uxkJ/HXMIZfOtNYCQ83FT1jm7gZTh6gxQThJLAAADqa0flmlQ6cqXDt8q3MYyULPnvJbehUu33PLOplclCiWLZrRIIMdvyYSAWK+Mc5z6jx6WV+jjNJBtIIa5KM/pthwEPxMr105p2Tt2NtvaB6f+qzySJy/uOPe2DXQR2mA260IXaj9eL00SlDoLphtr3B9xH6WzE40EZ0JAe7nm4VjhM8JD8C+fiNCoF4jvDqR3acCBjXQHMaVCbkv2NkU2FY7VcikqDl2N6zfK3BTIZtiHnRLUll5cSE8ZkC43O2F/QeOZ0vOOXbGqo4uJhDblv17JszeQq5nkSymduIBWrF34anpCoEiLkfYaxuzziME8rL7ccluRmycTlBqGhGlTAmvC03SJ524ijykqFSxmVU98lrPElHZwWJk8SPIXbo1MpBTBBu6uyZNcIpIaA70OjHf4dk7atAJB9C2oH2ADkVCKAYoFOREQa9TvE76+Pq8sd/5MspTeQNhF0YjYghb5ucF2DQmia5CdEMYNitGB26rBokHtsUHJfbG8W0GqT0Yhd97h57kT3MdOgDmFKj+BQ=----ATTACHMENT:----MzgyMTUyNTAyMDkxNDY1OSA0OTk3OTA2NjQ0MDk1MjYyIDY5NzY5MTA4NzI4NzU0NA==