@@ -31,15 +31,31 @@ public function testInstantiation() {
3131 }
3232 }
3333
34- /*
35- // TODO: need to loop possible configs
3634 public function testFromJSONInstantiations () {
37- $obj = ContextActivities::fromJSON('{"mbox":"' . COMMON_GROUP_MBOX . '", "member":[{"mbox":"' . COMMON_MBOX . '"}]}');
35+ $ common_activity = new TinCan \Activity (self ::$ common_activity_cfg );
36+
37+ $ all_json = array ();
38+ foreach (self ::$ listProps as $ k ) {
39+ $ getMethod = 'get ' . ucfirst ($ k );
40+
41+ $ prop_json = '" ' . $ k . '":[ ' . json_encode ($ common_activity ->asVersion ('1.0.0 ' )) . '] ' ;
42+
43+ array_push ($ all_json , $ prop_json );
44+
45+ $ obj = ContextActivities::fromJSON ('{ ' . $ prop_json . '} ' );
46+
47+ $ this ->assertInstanceOf ('TinCan\ContextActivities ' , $ obj );
48+ $ this ->assertEquals ([$ common_activity ], $ obj ->$ getMethod (), "$ k list " );
49+ }
50+
51+ $ obj = ContextActivities::fromJSON ('{ ' . join (", " , $ all_json ) . "} " );
52+
3853 $ this ->assertInstanceOf ('TinCan\ContextActivities ' , $ obj );
39- $this->assertSame(COMMON_GROUP_MBOX, $obj->getMbox(), 'mbox value');
40- $this->assertEquals([['mbox' => COMMON_MBOX]], $obj->getMember(), 'member list');
54+ $ this ->assertEquals ([$ common_activity ], $ obj ->getCategory (), "all props: category list " );
55+ $ this ->assertEquals ([$ common_activity ], $ obj ->getParent (), "all props: parent list " );
56+ $ this ->assertEquals ([$ common_activity ], $ obj ->getGrouping (), "all props: grouping list " );
57+ $ this ->assertEquals ([$ common_activity ], $ obj ->getOther (), "all props: other list " );
4158 }
42- */
4359
4460 // TODO: need to loop versions
4561 public function testAsVersion () {
0 commit comments