|
@@ -70,9 +70,86 @@ class StubCollatorTest extends LocaleTestCase
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
|
|
|
|
+ */
|
|
|
|
+ public function testCompare()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $collator->compare('a', 'b');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
|
|
|
|
+ */
|
|
|
|
+ public function testGetAttribute()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $collator->getAttribute(StubCollator::NUMERIC_COLLATION);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function testGetErrorCode()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $this->assertEquals(StubCollator::U_ZERO_ERROR, $collator->getErrorCode());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function testGetErrorMessage()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $this->assertEquals(StubCollator::U_ZERO_ERROR_MESSAGE, $collator->getErrorMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function testGetLocale()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $this->assertEquals('en', $collator->getLocale());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
|
|
|
|
+ */
|
|
|
|
+ public function testGetSortKey()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $collator->getSortKey('Hello');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
|
|
|
|
+ */
|
|
|
|
+ public function testGetStrength()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $collator->getStrength();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
|
|
|
|
+ */
|
|
|
|
+ public function testSetAttribute()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $collator->setAttribute(StubCollator::NUMERIC_COLLATION, StubCollator::ON);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
|
|
|
|
+ */
|
|
|
|
+ public function testSetStrength()
|
|
|
|
+ {
|
|
|
|
+ $collator = $this->createStubCollator();
|
|
|
|
+ $collator->setStrength(StubCollator::PRIMARY);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function testStaticCreate()
|
|
public function testStaticCreate()
|
|
{
|
|
{
|
|
$collator = StubCollator::create('en');
|
|
$collator = StubCollator::create('en');
|
|
$this->assertInstanceOf('Symfony\Component\Locale\Stub\StubCollator', $collator);
|
|
$this->assertInstanceOf('Symfony\Component\Locale\Stub\StubCollator', $collator);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ protected function createStubCollator()
|
|
|
|
+ {
|
|
|
|
+ return new StubCollator('en');
|
|
|
|
+ }
|
|
}
|
|
}
|