public function testReplaceNewNestedUpdatable() { StripeObject::init(); // Populate the $nestedUpdatableAttributes Set $s = new StripeObject(); $s->metadata = array('bar'); $this->assertSame($s->metadata, array('bar')); $s->metadata = array('baz', 'qux'); $this->assertSame($s->metadata, array('baz', 'qux')); }
} return $params; } public function jsonSerialize() { return $this->__toArray(true); } public function __toJSON() { if (defined('JSON_PRETTY_PRINT')) { return json_encode($this->__toArray(true), JSON_PRETTY_PRINT); } else { return json_encode($this->__toArray(true)); } } public function __toString() { $class = get_class($this); return $class . ' JSON: ' . $this->__toJSON(); } public function __toArray($recursive = false) { if ($recursive) { return Util\Util::convertStripeObjectToArray($this->_values); } else { return $this->_values; } } } StripeObject::init();