You are here

public function SkinrApiTest::testSkinrSkinDefaultsDuplicates in Skinr 8.2

Test default skin configurations (in code) with duplicates.

File

src/Tests/SkinrApiTest.php, line 449
Contains \Drupal\skinr\Tests\SkinrApiTest.

Class

SkinrApiTest
Tests Skinr API functionality.

Namespace

Drupal\skinr\Tests

Code

public function testSkinrSkinDefaultsDuplicates() {
  $uuid = '501ff0c3-db03-0944-9910-3a788f38097a';
  \Drupal::service('module_installer')
    ->install(array(
    'skinr_test_default',
  ));
  $default_skins = _skinr_skin_get_defaults();
  $this
    ->verbose(highlight_string('<?php ' . print_r($default_skins, TRUE), TRUE));

  // Clear caches.
  drupal_static_reset('_skinr_skin_get_defaults');
  \Drupal::service('module_installer')
    ->install(array(
    'skinr_test_default_duplicate',
  ));
  $default_skins = _skinr_skin_get_defaults();
  $this
    ->verbose(highlight_string('<?php ' . print_r($default_skins, TRUE), TRUE));
  $this
    ->assertFalse(is_array($default_skins[$uuid]), 'Default skin configuration replaced its duplicate.');

  // Clean up.
  \Drupal::service('module_installer')
    ->uninstall(array(
    'skinr_test_default_duplicate',
  ));
  drupal_static_reset('_skinr_skin_get_defaults');
}