You are here

protected function CommentTest::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/comment/tests/src/Unit/Migrate/d7/CommentTest.php \Drupal\Tests\comment\Unit\Migrate\d7\CommentTest::setUp()

Overrides MigrateSqlSourceTestCase::setUp

File

core/modules/comment/tests/src/Unit/Migrate/d7/CommentTest.php, line 56
Contains \Drupal\Tests\comment\Unit\Migrate\d7\CommentTest.

Class

CommentTest
Tests D7 comment source plugin.

Namespace

Drupal\Tests\comment\Unit\Migrate\d7

Code

protected function setUp() {
  $this->databaseContents['comment'] = $this->expectedResults;
  unset($this->databaseContents['comment'][0]['comment_body']);
  $this->databaseContents['node'] = array(
    array(
      'nid' => '1',
      'vid' => '1',
      'type' => 'test_content_type',
      'language' => 'en',
      'title' => 'A Node',
      'uid' => '1',
      'status' => '1',
      'created' => '1421727515',
      'changed' => '1421727515',
      'comment' => '2',
      'promote' => '1',
      'sticky' => '0',
      'tnid' => '0',
      'translate' => '0',
    ),
  );
  $this->databaseContents['field_config_instance'] = array(
    array(
      'id' => '14',
      'field_id' => '1',
      'field_name' => 'comment_body',
      'entity_type' => 'comment',
      'bundle' => 'comment_node_test_content_type',
      'data' => 'a:0:{}',
      'deleted' => '0',
    ),
  );
  $this->databaseContents['field_data_comment_body'] = array(
    array(
      'entity_type' => 'comment',
      'bundle' => 'comment_node_test_content_type',
      'deleted' => '0',
      'entity_id' => '1',
      'revision_id' => '1',
      'language' => 'und',
      'delta' => '0',
      'comment_body_value' => 'This is a comment',
      'comment_body_format' => 'filtered_html',
    ),
  );
  parent::setUp();
}