Файл: Main Website Files/assets/libraries/stripe-php-2.2.0/tests/ApiRequestorTest.php
Строк: 24
<?php
namespace Stripe;
class ApiRequestorTest extends TestCase
{
public function testEncodeObjects()
{
$reflector = new ReflectionClass('Stripe\ApiRequestor');
$method = $reflector->getMethod('_encodeObjects');
$method->setAccessible(true);
$a = array('customer' => new Customer('abcd'));
$enc = $method->invoke(null, $a);
$this->assertSame($enc, array('customer' => 'abcd'));
// Preserves UTF-8
$v = array('customer' => "☃");
$enc = $method->invoke(null, $v);
$this->assertSame($enc, $v);
// Encodes latin-1 -> UTF-8
$v = array('customer' => "xe9");
$enc = $method->invoke(null, $v);
$this->assertSame($enc, array('customer' => "xc3xa9"));
}
}