public function testToArray() { // from js $numbers = __::toArray((object) array('one' => 1, 'two' => 2, 'three' => 3)); $this->assertEquals('1, 2, 3', join(', ', $numbers), 'object flattened into array'); // docs $stooge = new StdClass(); $stooge->name = 'moe'; $stooge->age = 40; $this->assertEquals(array('name' => 'moe', 'age' => 40), __::toArray($stooge)); }