You are here

function ServicesResourceTaxonomyTests::testVocabularyDelete in Services 7.3

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

Test taxonomy vocabulary delete method.

File

tests/functional/ServicesResourceTaxonomyTests.test, line 265
Call the endpoint tests when no authentication is being used.

Class

ServicesResourceTaxonomyTests
Taxonomy resource test class.

Code

function testVocabularyDelete() {
  $path = $this->endpoint->path;
  $vocabulary = $this
    ->createVocabulary();
  $vid = $vocabulary['vid'];
  $this
    ->servicesDelete($path . '/taxonomy_vocabulary/' . $vid);

  // Load vocabulary from database. We use entity_load to reset static cache.
  $vocabularies_load = entity_load('taxonomy_vocabulary', array(
    $vid,
  ), array(), TRUE);
  $vocabulary_load = (array) array_pop($vocabularies_load);
  $this
    ->assertTrue(empty($vocabulary_load), 'Taxonomy vocabulary deleted properly.', 'TaxonomyVocabularyResource: Delete');
}