![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mcoil.corals.io/vendor/shippo/shippo-php/test/ |
<?php class Shippo_UtilTest extends TestCase { public function testIsList() { $list = array( 5, 'nstaoush', array() ); $this->assertTrue(Shippo_Util::isList($list)); $notlist = array( 5, 'nstaoush', array(), 'bar' => 'baz' ); $this->assertFalse(Shippo_Util::isList($notlist)); } public function testThatPHPHasValueSemanticsForArrays() { $original = array( 'php-arrays' => 'value-semantics' ); $derived = $original; $derived['php-arrays'] = 'reference-semantics'; $this->assertEquals('value-semantics', $original['php-arrays']); } public function testUtf8() { // UTF-8 string $x = "\xc3\xa9"; $this->assertEquals(Shippo_Util::utf8($x), $x); // Latin-1 string $x = "\xe9"; $this->assertEquals(Shippo_Util::utf8($x), "\xc3\xa9"); // Not a string $x = TRUE; $this->assertEquals(Shippo_Util::utf8($x), $x); } }