You are here

public function NodeorderCrudTest::testOrderableVocabulary in Node Order 8

Test orderable vocabularies.

File

src/Tests/NodeorderCrudTest.php, line 101

Class

NodeorderCrudTest
Test CRUD operations that Nodeorder relies on.

Namespace

Drupal\nodeorder\Tests

Code

public function testOrderableVocabulary() {

  // Vocabulary should default to not being orderable.
  $this
    ->assertFalse($this->nodeOrderManager
    ->vocabularyIsOrderable($this->vocabulary
    ->id()), 'The test vocabulary is not orderable by default.');

  // Enable 'orderable' on this vocabulary.
  \Drupal::configFactory()
    ->getEditable('nodeorder.settings')
    ->set('vocabularies', [
    $this->vocabulary
      ->id() => TRUE,
  ])
    ->save();

  // Ensure the vocabulary is sortable.
  $this
    ->assertTrue($this->nodeOrderManager
    ->vocabularyIsOrderable($this->vocabulary
    ->id()), 'The test vocabulary is orderable.');
}