Commit 3f1ff2d2 authored by drunken monkey's avatar drunken monkey Committed by borisson_
Browse files

Issue #2790133 by drunken monkey: Fix tests with the newest search api commits

parent d5c0117e
......@@ -5,6 +5,7 @@ namespace Drupal\facets\Tests;
use Drupal\Core\Url;
use Drupal\facets\Entity\Facet;
use Drupal\views\Entity\View;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Tests the overall functionality of the Facets admin UI.
......@@ -32,6 +33,25 @@ class IntegrationTest extends WebTestBase {
$this->blocks = NULL;
}
/**
* {@inheritdoc}
*/
protected function installModulesFromClassProperty(ContainerInterface $container) {
// This will just set the Drupal state to include the necessary bundles for
// our test entity type. Otherwise, fields from those bundles won't be found
// and thus removed from the test index. (We can't do it in setUp(), before
// calling the parent method, since the container isn't set up at that
// point.)
$bundles = array(
'entity_test_mulrev_changed' => array('label' => 'Entity Test Bundle'),
'item' => array('label' => 'item'),
'article' => array('label' => 'article'),
);
\Drupal::state()->set('entity_test_mulrev_changed.bundles', $bundles);
parent::installModulesFromClassProperty($container);
}
/**
* Tests permissions.
*/
......
......@@ -2,6 +2,8 @@
namespace Drupal\facets\Tests;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Tests the processor functionality.
*
......@@ -32,6 +34,25 @@ class ProcessorIntegrationTest extends WebTestBase {
$this->assertEqual($this->indexItems($this->indexId), 5, '5 items were indexed.');
}
/**
* {@inheritdoc}
*/
protected function installModulesFromClassProperty(ContainerInterface $container) {
// This will just set the Drupal state to include the necessary bundles for
// our test entity type. Otherwise, fields from those bundles won't be found
// and thus removed from the test index. (We can't do it in setUp(), before
// calling the parent method, since the container isn't set up at that
// point.)
$bundles = array(
'entity_test_mulrev_changed' => array('label' => 'Entity Test Bundle'),
'item' => array('label' => 'item'),
'article' => array('label' => 'article'),
);
\Drupal::state()->set('entity_test_mulrev_changed.bundles', $bundles);
parent::installModulesFromClassProperty($container);
}
/**
* Tests for the processors behavior in the backend.
*/
......
......@@ -2,6 +2,8 @@
namespace Drupal\facets\Tests;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Tests the integration of REST-views and facets.
*
......@@ -26,6 +28,25 @@ class RestIntegrationTest extends WebTestBase {
$this->assertEqual($this->indexItems($this->indexId), 5, '5 items were indexed.');
}
/**
* {@inheritdoc}
*/
protected function installModulesFromClassProperty(ContainerInterface $container) {
// This will just set the Drupal state to include the necessary bundles for
// our test entity type. Otherwise, fields from those bundles won't be found
// and thus removed from the test index. (We can't do it in setUp(), before
// calling the parent method, since the container isn't set up at that
// point.)
$bundles = array(
'entity_test_mulrev_changed' => array('label' => 'Entity Test Bundle'),
'item' => array('label' => 'item'),
'article' => array('label' => 'article'),
);
\Drupal::state()->set('entity_test_mulrev_changed.bundles', $bundles);
parent::installModulesFromClassProperty($container);
}
/**
* Tests that the facet results are correct.
*/
......
......@@ -6,6 +6,7 @@ use Drupal\Core\Url;
use Drupal\facets\FacetInterface;
use Drupal\facets\Entity\Facet;
use Drupal\facets\FacetSourceInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Tests the overall functionality of the Facets admin UI.
......@@ -40,6 +41,25 @@ class UrlIntegrationTest extends WebTestBase {
$this->assertEqual($this->indexItems($this->indexId), 5, '5 items were indexed.');
}
/**
* {@inheritdoc}
*/
protected function installModulesFromClassProperty(ContainerInterface $container) {
// This will just set the Drupal state to include the necessary bundles for
// our test entity type. Otherwise, fields from those bundles won't be found
// and thus removed from the test index. (We can't do it in setUp(), before
// calling the parent method, since the container isn't set up at that
// point.)
$bundles = array(
'entity_test_mulrev_changed' => array('label' => 'Entity Test Bundle'),
'item' => array('label' => 'item'),
'article' => array('label' => 'article'),
);
\Drupal::state()->set('entity_test_mulrev_changed.bundles', $bundles);
parent::installModulesFromClassProperty($container);
}
/**
* Tests various url integration things.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment