public function testIsObject() { // from js $this->assertTrue(__u::isObject((object) array(1, 2, 3))); $this->assertTrue(__u::isObject(function () { }), 'and functions'); $this->assertFalse(__u::isObject(null), 'but not null'); $this->assertFalse(__u::isObject('string'), 'and not string'); $this->assertFalse(__u::isObject(12), 'and not number'); $this->assertFalse(__u::isObject(true), 'and not boolean'); if (class_exists('DateTimeZone')) { $this->assertTrue(__u::isObject(new DateTimeZone('America/Denver')), 'objects are'); } // extra $this->assertTrue(__u::isObject(new StdClass()), 'empty objects work'); $this->assertTrue(__u(new StdClass())->isObject(), 'works with OO-style call'); $this->assertFalse(__u(2)->isObject()); }