getMockResponse('group'); $group = $this->parseResponse($response); $this->assertEquals(count($group), 1); $group = reset($group); // Basic properties $this->assertEquals($group->getUuid(), '0df4bcd7-54b4-4559-a960-60b5042d3d48'); $this->assertEquals($group->getVuuid(), 'c6df91b9-58bd-4a5f-a52e-64ec18f267f0'); $this->assertEquals($group->getInternalId(), '41'); $this->assertEquals($group->getInternalVid(), '8935'); // Node level fields $this->assertEquals($group->apiUri(), 'https://radar.squat.net/api/1.1/node/0df4bcd7-54b4-4559-a960-60b5042d3d48'); $body_text = "

Joe's Garage is een ontmoetingsplek voor al dan niet krakers uit de transvaalbuurt en omstreken.

\n"; $this->assertEquals($group->getBody(), $body_text); $this->assertEquals($group->getBodyRaw(), array('value' => $body_text, 'summary' => '', 'format' => 'rich_text_editor')); $this->assertEquals($group->getUrlView(),'https://radar.squat.net/nl/amsterdam/joes-garage?language=nl'); $this->assertEquals($group->getUrlEdit(),'https://radar.squat.net/nl/node/41/edit?language=nl'); $this->assertEquals($group->getStatus(), TRUE); $this->assertEquals($group->getCreated()->getTimestamp(),'1409775185'); $this->assertEquals($group->getUpdated()->getTimestamp(),'1424352703'); // Node level references $categories = $group->getCategories(); $this->assertEquals(count($categories), 6); $category = reset($categories); $this->assertTrue($category instanceof \Radar\Connect\Entity\TaxonomyTerm); $this->assertEquals($category->apiUri(),'https://radar.squat.net/api/1.1/taxonomy_term/e97f372b-29bc-460b-bff6-35d2462411ff?language=nl'); $topics = $group->getTopics(); $topic = reset($topics); $this->assertTrue($topic instanceof \Radar\Connect\Entity\TaxonomyTerm); $this->assertEquals($topic->apiUri(), 'https://radar.squat.net/api/1.1/taxonomy_term/82f00d0a-03df-40ec-a06d-67b875675858?language=nl'); // Simple fields. $this->assertTrue($group instanceof Group); $this->assertEquals($group->getTitle(), 'Joe\'s Garage'); //$this->assertEquals($group->getImageRaw(), ''); //$this->assertEquals($group->getGroupLogoRaw(), ''); $this->assertEquals($group->getEmail(), 'joe@squat.net'); $this->assertEquals($group->getLinkRaw(), array(array('url' => 'http://www.joesgarage.nl/', 'attributes' => array()))); $this->assertEquals($group->getLink(), array('http://www.joesgarage.nl/')); $this->assertEquals($group->getPhone(), null); $opening_times = "

Maandag: 19u Volkseten Vegazulu

\n

Dinsdag: 11u/15u Kraakspreekuur, (daarna is er een borrel)

\n

Dinsdag: 20u/21u30 Kraakspreekuur Oost

\n

Woensdag: 15u/18u Lonely Collective Day Cafe

\n

Donderdag: 19u Volkseten Vegazulu

\n

Zaterdag: 14u/18u Weggeefwinkel

\n

Zondag: 20u Filmavonden/Infoavonden

\n"; $this->assertEquals($group->getOpeningTimesRaw(), array('value' => $opening_times, 'format' => 'rich_text_editor')); $this->assertEquals($group->getOpeningTimes(), $opening_times); // Entity references. $locations = $group->getLocations(); $this->assertTrue($locations[0] instanceof \Radar\Connect\Entity\Location); $this->assertEquals($locations[0]->apiUri(), 'https://radar.squat.net/api/1.1/location/3c58abc1-e095-4db5-996d-2a064cebb2d3?language=nl'); } }