public function test200UnsetTheme()
 {
     $this->upFixture(new SampleCollectionsFixture());
     $collection = SampleCollectionsFixture::getCommunityCollection(1);
     $json = ['title' => '* my edited title', 'description' => '* my edited description', 'theme_ids' => []];
     $this->requestEditCollection($collection->getId(), $json)->auth(DemoAccountFixture::getAccount()->getAPIKey())->execute()->expectStatusCode(200)->expectJSONContentType()->expectJSONBody(['success' => true, 'entity' => ['title' => $json['title'], 'description' => $json['description'], 'theme_ids' => $json['theme_ids']]]);
 }
 public function test409_private_and_public_enabled()
 {
     $this->upFixture(new SampleCollectionsFixture());
     $collection = SampleCollectionsFixture::getCommunityCollection(1);
     $options = ['is_private' => true, 'public_enabled' => true, 'moderation_contract' => true];
     $this->requestSetPublicOptions($collection->getId(), $options)->auth(DemoAccountFixture::getAccount()->getAPIKey())->execute()->expectStatusCode(409)->expectJSONContentType()->expectJSONBody(['success' => false, 'error' => $this->expectString()]);
 }
 public function test200()
 {
     $this->upFixture(new SampleCollectionsFixture());
     $collectionToDelete = SampleCollectionsFixture::getCommunityCollection(1);
     $collectionId = $collectionToDelete->getId();
     list(, $communityId) = explode(':', $collectionToDelete->getOwnerSID());
     $this->requestGetCommunity($communityId)->execute()->expectStatusCode(200)->expectJSONContentType()->expect(function (array $jsonResponse) use($collectionId) {
         $collectionIds = array_map(function (array $input) {
             return $input['collection_id'];
         }, $jsonResponse['entity']['community']['collections']);
         $this->assertTrue(in_array($collectionId, $collectionIds));
     });
     $this->requestDeleteCollection($collectionToDelete->getId())->auth(DemoAccountFixture::getAccount()->getAPIKey())->execute()->expectStatusCode(200)->expectJSONContentType()->expectJSONBody(['success' => true]);
     $this->requestGetCommunity($communityId)->execute()->expectStatusCode(200)->expectJSONContentType()->expect(function (array $jsonResponse) use($collectionId) {
         $collectionIds = array_map(function (array $input) {
             return $input['collection_id'];
         }, $jsonResponse['entity']['community']['collections']);
         $this->assertFalse(in_array($collectionId, $collectionIds));
     });
 }