From bd798d9fd71fc84303fdd1cc493044cfdfaa7498 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 2 Jan 2016 17:20:48 -0500 Subject: [PATCH] Add pass/fail test for utf8extended. --- tests/TestCase/Validation/ValidatorTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/TestCase/Validation/ValidatorTest.php b/tests/TestCase/Validation/ValidatorTest.php index bdab464119b..fa2f5bd472b 100644 --- a/tests/TestCase/Validation/ValidatorTest.php +++ b/tests/TestCase/Validation/ValidatorTest.php @@ -1417,12 +1417,29 @@ public function testAscii() */ public function testUtf8() { + // Grinning face + $extended = 'some' . "\xf0\x9f\x98\x80" . 'value'; $validator = new Validator(); + $this->assertProxyMethod($validator, 'utf8', null, [['extended' => false]]); $this->assertEmpty($validator->errors(['username' => 'ü'])); + $this->assertNotEmpty($validator->errors(['username' => $extended])); + } + + /** + * Test utf8extended proxy method. + * + * @return void + */ + public function testUtf8Extended() + { + // Grinning face + $extended = 'some' . "\xf0\x9f\x98\x80" . 'value'; + $validator = new Validator(); $this->assertProxyMethod($validator, 'utf8Extended', null, [['extended' => true]], 'utf8'); $this->assertEmpty($validator->errors(['username' => 'ü'])); + $this->assertEmpty($validator->errors(['username' => $extended])); } /**