Esempio n. 1
0
 /**
  * Test utf8 extended
  *
  * @return void
  */
 public function testUtf8Extended()
 {
     $this->assertFalse(Validation::utf8([], ['extended' => true]));
     $this->assertFalse(Validation::utf8(1001, ['extended' => true]));
     $this->assertFalse(Validation::utf8(3.14, ['extended' => true]));
     $this->assertFalse(Validation::utf8(new \StdClass(), ['extended' => true]));
     $this->assertTrue(Validation::utf8('1 big blue bus.', ['extended' => true]));
     $this->assertTrue(Validation::utf8(',.<>[]{;/?\\)()', ['extended' => true]));
     // Latin-1 supplement
     $this->assertTrue(Validation::utf8('some' . "‚" . 'value', ['extended' => true]));
     $this->assertTrue(Validation::utf8('some' . "ÿ" . 'value', ['extended' => true]));
     // End of BMP
     $this->assertTrue(Validation::utf8('some' . "�" . 'value', ['extended' => true]));
     // Start of supplementary multilingual plane
     $this->assertTrue(Validation::utf8('some' . "𐀀" . 'value', ['extended' => true]));
     // Grinning face
     $this->assertTrue(Validation::utf8('some' . "😀" . 'value', ['extended' => true]));
 }