/** * @depends test_create_json * */ public function test_addJson() { $JsonString = ' [{ "description" : "Description 1 Json", "title" : "Title 1 Json" },{ "description" : "Description 2 Json", "title" : "Title 2 Json" },{ "description" : "Description 3 Json", "title" : "Title 3 Json " }] '; $c = Unify::create(true)->addJson($JsonString); $this->assertEquals(true, $c[1]->offsetExists('title')); $this->assertEquals('Description 3 Json', $c->offsetGet(2)->description); }
/** * @expectedException InvalidArgumentException * @expectedExceptionCode 120 */ public function test_create2_exception() { Unify::create(new \stdClass()); }
/** * @depends test_createWith */ public function test_create_string() { $c = Unify::create('operation'); $this->assertEquals(true, $c instanceof Collection); $this->assertEquals(true, $c->extensions()->exists('renameAll')); $this->assertEquals(false, $c->extensions()->exists('avg')); $this->assertEquals(false, $c->extensions()->exists('toHTML')); }