'; public function testParse() { $doc = new \DomDocument(); $doc->loadXml($this->viewNode); $contentBlocks = $doc->getElementsByTagName('script'); $tags = array(); foreach ($contentBlocks as $content) { $tags[] = DataPipelining::parse($content); } $this->assertEquals(1, count($tags)); $expected = array( array( 'type' => 'os:DataRequest', 'key' => 'viewer', 'userId' => '@viewer', 'groupId' => '@self', 'method' => 'people.get', ), array( 'type' => 'os:DataRequest', 'key' => 'viewerFriends', 'userId' => '@viewer', 'groupId' => '@friends', 'method' => 'people.get', ), array( 'type' => 'os:DataRequest', 'method' => 'people.get', 'userId' => '@viewer', 'groupId' => '@self', ), array( 'type' => 'os:DataRequest', 'method' => 'people.get', 'userId' => '@owner', 'groupId' => '@self', ), array( 'type' => 'os:DataRequest', 'key' => 'appdata', 'userId' => '@viewer', 'fields' => 'field', 'method' => 'appdata.get', ), array( 'type' => 'os:DataRequest', 'key' => 'appdataFriends', 'userId' => '@viewer', 'groupId' => '@friends', 'fields' => 'field', 'method' => 'appdata.get', ), array( 'type' => 'os:DataRequest', 'method' => 'activities.get', ), array( 'type' => 'os:HttpRequest', 'href' => 'http://example.com', ), ); $this->assertEquals($expected, $tags[0]); } }