You are here

function ServicesResourceTaxonomyTests::testVocabularyUpdate in Services 6.3

Same name and namespace in other branches
  1. 7.3 tests/functional/ServicesResourceTaxonomyTests.test \ServicesResourceTaxonomyTests::testVocabularyUpdate()

Test taxonomy vocabulary update.

File

tests/functional/ServicesResourceTaxonomyTests.test, line 129

Class

ServicesResourceTaxonomyTests
Run test cases for the endpoint with no authentication turned on.

Code

function testVocabularyUpdate() {
  $path = $this->endpoint->path;
  $vocabulary = $this
    ->createVocabulary();
  $vid = $vocabulary['vid'];
  $vocabulary['name'] = $this
    ->randomName();
  $vocabulary['description'] = $this
    ->randomString();
  $response = $this
    ->servicesPUT($path . '/taxonomy_vocabulary/' . $vid, $vocabulary);
  $vocabulary_load = (array) taxonomy_vocabulary_load($vid, TRUE);
  $vocabulary_intersect = array_intersect_assoc($vocabulary, $vocabulary_load);
  $this
    ->assertEqual($vocabulary, $vocabulary_intersect, t('Taxonomy vocabulary updated properly.'), 'TaxonomyVocabularyResource: Update');
}