You are here

public function XmlTest::setUp in Views XML Backend 8

Overrides ViewsXmlBackendTestBase::setUp

File

tests/src/Unit/Plugin/views/query/XmlTest.php, line 38
Contains \Drupal\Tests\views_xml_backend\Unit\Plugin\views\query\XmlTest.

Class

XmlTest
@coversDefaultClass \Drupal\views_xml_backend\Plugin\views\query\Xml @group views_xml_backend

Namespace

Drupal\Tests\views_xml_backend\Unit\Plugin\views\query

Code

public function setUp() {
  parent::setUp();
  if (!defined('FILE_MODIFY_PERMISSIONS')) {
    define('FILE_MODIFY_PERMISSIONS', 2);
  }
  if (!defined('FILE_CREATE_DIRECTORY')) {
    define('FILE_CREATE_DIRECTORY', 1);
  }
  if (!defined('FILE_EXISTS_REPLACE')) {
    define('FILE_EXISTS_REPLACE', 1);
  }
  vfsStream::setup('vxb');
  new Settings([
    'views_xml_backend_cache_directory' => 'vfs://vxb/filecache',
  ]);

  // Create a mock and queue two responses.
  $mock = new MockHandler([
    new Response(200, [
      'X-Foo' => 'Bar',
    ]),
  ]);
  $handler = HandlerStack::create($mock);
  $this->client = new Client([
    'handler' => $handler,
  ]);
  $this->nullCache = new NullBackend('bin');
  $this->nullLogger = new NullLogger();
  $this->messenger = new TestMessenger();
}