コード例 #1
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->databaseContents['term_node'] = array(array('nid' => '1', 'vid' => '1', 'tid' => '1'), array('nid' => '1', 'vid' => '1', 'tid' => '4'), array('nid' => '1', 'vid' => '1', 'tid' => '5'));
     $this->databaseContents['node'] = array(array('nid' => '1', 'vid' => '1', 'type' => 'story', 'language' => '', 'title' => 'Test title', 'uid' => '1', 'status' => '1', 'created' => '1388271197', 'changed' => '1420861423', 'comment' => '0', 'promote' => '0', 'moderate' => '0', 'sticky' => '0', 'tnid' => '0', 'translate' => '0'));
     $this->databaseContents['term_data'] = array(array('tid' => '1', 'vid' => '3', 'name' => 'term 1 of vocabulary 3', 'description' => 'description of term 1 of vocabulary 3', 'weight' => '0'), array('tid' => '4', 'vid' => '3', 'name' => 'term 4 of vocabulary 3', 'description' => 'description of term 4 of vocabulary 3', 'weight' => '6'), array('tid' => '5', 'vid' => '3', 'name' => 'term 5 of vocabulary 3', 'description' => 'description of term 5 of vocabulary 3', 'weight' => '7'));
     parent::setUp();
 }
コード例 #2
0
ファイル: NodeByNodeTypeTest.php プロジェクト: nsp15/Drupal8
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $database_contents = $this->expectedResults;
     array_walk($this->expectedResults, function (&$row) {
         $row['node_uid'] = $row['uid'];
         $row['revision_uid'] = $row['uid'] + 1;
         unset($row['uid']);
     });
     $database_contents[] = array('nid' => 5, 'vid' => 5, 'type' => 'article', 'language' => 'en', 'title' => 'node title 5', 'uid' => 1, 'status' => 1, 'timestamp' => 1279290908, 'created' => 1279290908, 'changed' => 1279308993, 'comment' => 0, 'promote' => 1, 'moderate' => 0, 'sticky' => 0, 'tnid' => 0, 'translate' => 0, 'body' => 'body for node 5', 'teaser' => 'body for node 5', 'format' => 1, 'log' => 'log message 3');
     // Add another row with an article node and make sure it is not migrated.
     foreach ($database_contents as $k => $row) {
         foreach (array('nid', 'vid', 'title', 'uid', 'body', 'teaser', 'format', 'timestamp', 'log') as $field) {
             $this->databaseContents['node_revisions'][$k][$field] = $row[$field];
             switch ($field) {
                 case 'nid':
                 case 'vid':
                     break;
                 case 'uid':
                     $this->databaseContents['node_revisions'][$k]['uid']++;
                     break;
                 default:
                     unset($row[$field]);
                     break;
             }
         }
         $this->databaseContents['node'][$k] = $row;
     }
     parent::setUp();
 }
コード例 #3
0
ファイル: NodeTest.php プロジェクト: dev981/gaptest
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         foreach (array('nid', 'vid', 'title', 'uid', 'body', 'teaser', 'format', 'timestamp', 'log') as $field) {
             $this->databaseContents['node_revisions'][$k][$field] = $row[$field];
             switch ($field) {
                 case 'nid':
                 case 'vid':
                     break;
                 case 'uid':
                     $this->databaseContents['node_revisions'][$k]['uid']++;
                     break;
                 default:
                     unset($row[$field]);
                     break;
             }
         }
         $this->databaseContents['node'][$k] = $row;
     }
     array_walk($this->expectedResults, function (&$row) {
         $row['node_uid'] = $row['uid'];
         $row['revision_uid'] = $row['uid'] + 1;
         unset($row['uid']);
     });
     parent::setUp();
 }
コード例 #4
0
ファイル: NodeTest.php プロジェクト: eigentor/tommiblog
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         foreach (array('nid', 'vid', 'title', 'uid', 'timestamp', 'log') as $field) {
             $this->databaseContents['node_revision'][$k][$field] = $row[$field];
             switch ($field) {
                 case 'nid':
                 case 'vid':
                     break;
                 case 'uid':
                     $this->databaseContents['node_revision'][$k]['uid']++;
                     break;
                 default:
                     unset($row[$field]);
                     break;
             }
         }
         $this->databaseContents['node'][$k] = $row;
     }
     array_walk($this->expectedResults, function (&$row) {
         $row['node_uid'] = $row['uid'];
         $row['revision_uid'] = $row['uid'] + 1;
         unset($row['uid']);
     });
     $this->databaseContents['field_config_instance'] = array(array('id' => '2', 'field_id' => '2', 'field_name' => 'body', 'entity_type' => 'node', 'bundle' => 'page', 'data' => 'a:0:{}', 'deleted' => '0'), array('id' => '2', 'field_id' => '2', 'field_name' => 'body', 'entity_type' => 'node', 'bundle' => 'article', 'data' => 'a:0:{}', 'deleted' => '0'));
     $this->databaseContents['field_revision_body'] = array(array('entity_type' => 'node', 'bundle' => 'page', 'deleted' => '0', 'entity_id' => '1', 'revision_id' => '1', 'language' => 'en', 'delta' => '0', 'body_value' => 'Foobaz', 'body_summary' => '', 'body_format' => 'filtered_html'));
     parent::setUp();
 }
コード例 #5
0
ファイル: BlockTest.php プロジェクト: 318io/318-io
 /**
  * Prepopulate database contents.
  */
 protected function setUp()
 {
     $this->databaseContents['blocks'] = $this->expectedResults;
     $this->databaseContents['blocks_roles'] = $this->expectedBlocksRoles;
     $this->databaseContents['system'] = array(array('filename' => 'modules/system/system.module', 'name' => 'system', 'type' => 'module', 'owner' => '', 'status' => '1', 'throttle' => '0', 'bootstrap' => '0', 'schema_version' => '6055', 'weight' => '0', 'info' => 'a:0:{}'));
     parent::setUp();
 }
コード例 #6
0
ファイル: CommentTypeTest.php プロジェクト: ddrozdik/dmaps
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->databaseContents['node_type'] = array(array('type' => 'article', 'name' => 'Article', 'base' => 'node_content', 'module' => 'node', 'description' => 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.', 'help' => 'Help text for articles', 'has_title' => '1', 'title_label' => 'Title', 'custom' => '1', 'modified' => '1', 'locked' => '0', 'disabled' => '0', 'orig_type' => 'article'));
     $this->databaseContents['field_config_instance'] = array(array('id' => '14', 'field_id' => '1', 'field_name' => 'comment_body', 'entity_type' => 'comment', 'bundle' => 'comment_node_article', 'data' => 'a:0:{}', 'deleted' => '0'));
     $this->databaseContents['variable'] = array(array('name' => 'comment_default_mode_article', 'value' => serialize(1)), array('name' => 'comment_per_page_article', 'value' => serialize(50)), array('name' => 'comment_anonymous_article', 'value' => serialize(0)), array('name' => 'comment_form_location_article', 'value' => serialize(1)), array('name' => 'comment_preview_article', 'value' => serialize(0)), array('name' => 'comment_subject_article', 'value' => serialize(1)));
     parent::setUp();
 }
コード例 #7
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $empty_array = serialize([]);
     $this->databaseContents['content_node_field'] = array(array('field_name' => 'field_test_filefield', 'type' => 'filefield', 'global_settings' => $empty_array, 'required' => '0', 'multiple' => '0', 'db_storage' => '1', 'module' => 'filefield', 'db_columns' => $empty_array, 'active' => '1', 'locked' => '0'));
     $this->databaseContents['content_node_field_instance'] = array(array('field_name' => 'field_test_filefield', 'type_name' => 'story', 'weight' => '8', 'label' => 'File Field', 'widget_type' => 'filefield_widget', 'widget_settings' => $empty_array, 'display_settings' => $empty_array, 'description' => 'An example image field.', 'widget_module' => 'filefield', 'widget_active' => '1'));
     parent::setUp();
 }
コード例 #8
0
ファイル: NodeTestBase.php プロジェクト: eigentor/tommiblog
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->databaseContents['content_node_field'] = array(array('field_name' => 'field_test_four', 'type' => 'number_float', 'global_settings' => 'a:0:{}', 'required' => '0', 'multiple' => '0', 'db_storage' => '1', 'module' => 'number', 'db_columns' => 'a:1:{s:5:"value";a:3:{s:4:"type";s:5:"float";s:8:"not null";b:0;s:8:"sortable";b:1;}}', 'active' => '1', 'locked' => '0'));
     $this->databaseContents['content_node_field_instance'] = array(array('field_name' => 'field_test_four', 'type_name' => 'story', 'weight' => '3', 'label' => 'Float Field', 'widget_type' => 'number', 'widget_settings' => 'a:0:{}', 'display_settings' => 'a:0:{}', 'description' => 'An example float field.', 'widget_module' => 'number', 'widget_active' => '1'));
     $this->databaseContents['content_type_story'] = array(array('nid' => 5, 'vid' => 5, 'uid' => 5, 'field_test_four_value' => '3.14159'));
     $this->databaseContents['system'] = array(array('type' => 'module', 'name' => 'content', 'schema_version' => 6001, 'status' => TRUE));
     $this->databaseContents['node'] = [['nid' => 1, 'vid' => 1, 'type' => 'page', 'language' => 'en', 'title' => 'node title 1', 'uid' => 1, 'status' => 1, 'created' => 1279051598, 'changed' => 1279051598, 'comment' => 2, 'promote' => 1, 'moderate' => 0, 'sticky' => 0, 'translate' => 0, 'tnid' => 0], ['nid' => 2, 'vid' => 2, 'type' => 'page', 'language' => 'en', 'title' => 'node title 2', 'uid' => 1, 'status' => 1, 'created' => 1279290908, 'changed' => 1279308993, 'comment' => 0, 'promote' => 1, 'moderate' => 0, 'sticky' => 0, 'translate' => 0, 'tnid' => 0], ['nid' => 5, 'vid' => 5, 'type' => 'story', 'language' => 'en', 'title' => 'node title 5', 'uid' => 1, 'status' => 1, 'created' => 1279290908, 'changed' => 1279308993, 'comment' => 0, 'promote' => 1, 'moderate' => 0, 'sticky' => 0, 'translate' => 0, 'tnid' => 0], ['nid' => 6, 'vid' => 6, 'type' => 'story', 'language' => 'en', 'title' => 'node title 6', 'uid' => 1, 'status' => 1, 'created' => 1279290909, 'changed' => 1279308994, 'comment' => 0, 'promote' => 1, 'moderate' => 0, 'sticky' => 0, 'translate' => 0, 'tnid' => 6], ['nid' => 7, 'vid' => 7, 'type' => 'story', 'language' => 'fr', 'title' => 'node title 7', 'uid' => 1, 'status' => 1, 'created' => 1279290910, 'changed' => 1279308995, 'comment' => 0, 'promote' => 1, 'moderate' => 0, 'sticky' => 0, 'translate' => 0, 'tnid' => 6]];
     foreach ($this->databaseContents['node'] as $k => $row) {
         // Find the equivalent row from expected results.
         $result_row = NULL;
         foreach ($this->expectedResults as $result) {
             if (in_array($result['nid'], [$row['nid'], $row['tnid']]) && $result['language'] == $row['language']) {
                 $result_row = $result;
                 break;
             }
         }
         // Populate node_revisions.
         foreach (array('nid', 'vid', 'title', 'uid', 'body', 'teaser', 'format', 'timestamp', 'log') as $field) {
             $value = isset($row[$field]) ? $row[$field] : $result_row[$field];
             $this->databaseContents['node_revisions'][$k][$field] = $value;
             if ($field == 'uid') {
                 $this->databaseContents['node_revisions'][$k]['uid']++;
             }
         }
     }
     array_walk($this->expectedResults, function (&$row) {
         $row['node_uid'] = $row['uid'];
         $row['revision_uid'] = $row['uid'] + 1;
         unset($row['uid']);
     });
     parent::setUp();
 }
コード例 #9
0
ファイル: UrlAliasTest.php プロジェクト: nsp15/Drupal8
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $row) {
         $this->databaseContents['url_alias'][] = $row;
     }
     parent::setUp();
 }
コード例 #10
0
ファイル: NodeTest.php プロジェクト: sgtsaughter/d8portfolio
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->databaseContents['content_node_field'] = array(array('field_name' => 'field_test_four', 'type' => 'number_float', 'global_settings' => 'a:0:{}', 'required' => '0', 'multiple' => '0', 'db_storage' => '1', 'module' => 'number', 'db_columns' => 'a:1:{s:5:"value";a:3:{s:4:"type";s:5:"float";s:8:"not null";b:0;s:8:"sortable";b:1;}}', 'active' => '1', 'locked' => '0'));
     $this->databaseContents['content_node_field_instance'] = array(array('field_name' => 'field_test_four', 'type_name' => 'story', 'weight' => '3', 'label' => 'Float Field', 'widget_type' => 'number', 'widget_settings' => 'a:0:{}', 'display_settings' => 'a:0:{}', 'description' => 'An example float field.', 'widget_module' => 'number', 'widget_active' => '1'));
     $this->databaseContents['content_type_story'] = array(array('nid' => 5, 'vid' => 5, 'uid' => 5, 'field_test_four_value' => '3.14159'));
     $this->databaseContents['system'] = array(array('type' => 'module', 'name' => 'content', 'schema_version' => 6001, 'status' => TRUE));
     foreach ($this->expectedResults as $k => $row) {
         foreach (array('nid', 'vid', 'title', 'uid', 'body', 'teaser', 'format', 'timestamp', 'log') as $field) {
             $this->databaseContents['node_revisions'][$k][$field] = $row[$field];
             switch ($field) {
                 case 'nid':
                 case 'vid':
                     break;
                 case 'uid':
                     $this->databaseContents['node_revisions'][$k]['uid']++;
                     break;
                 default:
                     unset($row[$field]);
                     break;
             }
         }
         $this->databaseContents['node'][$k] = $row;
     }
     array_walk($this->expectedResults, function (&$row) {
         $row['node_uid'] = $row['uid'];
         $row['revision_uid'] = $row['uid'] + 1;
         unset($row['uid']);
     });
     parent::setUp();
 }
コード例 #11
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         $this->databaseContents['aggregator_feed'][$k] = $row;
     }
     parent::setUp();
 }
コード例 #12
0
ファイル: NodeTypeTest.php プロジェクト: ddrozdik/dmaps
 /**
  * Prepopulate contents with results.
  */
 protected function setUp()
 {
     $this->databaseContents['node_type'] = $this->expectedResults;
     $this->databaseContents['variable'] = array(array('name' => 'node_options_page', 'value' => 'a:1:{i:0;s:6:"status";}'), array('name' => 'node_options_story', 'value' => 'a:1:{i:0;s:6:"status";}'));
     $this->databaseContents['field_config_instance'] = array(array('entity_type' => 'node', 'bundle' => 'page', 'field_name' => 'body', 'data' => 'a:1:{s:5:"label";s:4:"Body";}'), array('entity_type' => 'node', 'bundle' => 'story', 'field_name' => 'body', 'data' => 'a:1:{s:5:"label";s:4:"Body";}'));
     parent::setUp();
 }
コード例 #13
0
 /**
  * Prepopulate contents with results.
  */
 protected function setUp()
 {
     $this->databaseContents['profile_fields'] = $this->expectedResults;
     foreach ($this->databaseContents['profile_fields'] as &$row) {
         $row['options'] = serialize([]);
     }
     parent::setUp();
 }
コード例 #14
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         $this->databaseContents['contact'][$k] = $row;
         $this->databaseContents['contact'][$k]['recipients'] = implode(',', $row['recipients']);
     }
     parent::setUp();
 }
コード例 #15
0
ファイル: MenuLinkSourceTest.php プロジェクト: ddrozdik/dmaps
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         $row['options'] = serialize($row['options']);
         $this->databaseContents['menu_links'][$k] = $row;
     }
     parent::setUp();
 }
コード例 #16
0
ファイル: MenuTest.php プロジェクト: nsp15/Drupal8
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     // This array stores the database.
     foreach ($this->expectedResults as $k => $row) {
         $this->databaseContents['menu_custom'][$k] = $row;
     }
     parent::setUp();
 }
コード例 #17
0
ファイル: UserTest.php プロジェクト: eigentor/tommiblog
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->databaseContents['users'][] = ['uid' => '2', 'name' => 'Odo', 'pass' => '$S$DVpvPItXvnsmF3giVEe7Jy2lG.SCoEs8uKwpHsyPvdeNAaNZYxZ8', 'mail' => '*****@*****.**', 'theme' => '', 'signature' => '', 'signature_format' => 'filtered_html', 'created' => '1432750741', 'access' => '0', 'login' => '0', 'status' => '1', 'timezone' => 'America/Chicago', 'language' => '', 'picture' => '0', 'init' => '*****@*****.**', 'data' => 'a:1:{s:7:"contact";i:1;}'];
     $this->databaseContents['users_roles'][] = ['uid' => 2, 'rid' => 2];
     $this->databaseContents['role'][] = ['rid' => 2, 'name' => 'authenticated user', 'weight' => 0];
     $this->databaseContents['field_config_instance'] = [['id' => '33', 'field_id' => '11', 'field_name' => 'field_file', 'entity_type' => 'user', 'bundle' => 'user', 'data' => 'a:0:{}', 'deleted' => '0']];
     $this->databaseContents['field_data_field_file'] = [['entity_type' => 'user', 'bundle' => 'user', 'deleted' => 0, 'entity_id' => 2, 'revision_id' => NULL, 'language' => 'und', 'delta' => 0, 'field_file_fid' => 99, 'field_file_display' => 1, 'field_file_description' => 'None']];
     parent::setUp();
 }
コード例 #18
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     // This array stores the database.
     foreach ($this->expectedResults as $k => $row) {
         $this->databaseContents['menu_links'][$k] = $row;
         $this->databaseContents['menu_links'][$k]['options'] = serialize($this->databaseContents['menu_links'][$k]['options']);
     }
     parent::setUp();
 }
コード例 #19
0
ファイル: CommentTest.php プロジェクト: aWEBoLabs/taxi
 /**
  * {@inheritdoc}
  */
 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();
 }
コード例 #20
0
ファイル: RoleTest.php プロジェクト: scratch/gai
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $row) {
         $this->databaseContents['permission'][] = array('perm' => implode(', ', $row['permissions']), 'rid' => $row['rid']);
         unset($row['permissions']);
         $this->databaseContents['role'][] = $row;
     }
     $this->databaseContents['filter_formats'][] = array('format' => 1, 'roles' => '');
     parent::setUp();
 }
コード例 #21
0
ファイル: UserTest.php プロジェクト: scratch/gai
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         $this->databaseContents['users'][$k] = $row;
     }
     // getDatabase() will not create empty tables, so we need to insert data
     // even if it's irrelevant to the test.
     $this->databaseContents['users_roles'] = array(array('uid' => 99, 'rid' => 99));
     parent::setUp();
 }
コード例 #22
0
ファイル: VocabularyTest.php プロジェクト: aWEBoLabs/taxi
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as &$row) {
         foreach ($row['node_types'] as $type) {
             $this->databaseContents['vocabulary_node_types'][] = ['type' => $type, 'vid' => $row['vid']];
         }
         unset($row['node_types']);
     }
     $this->databaseContents['vocabulary'] = $this->expectedResults;
     parent::setUp();
 }
コード例 #23
0
ファイル: FieldTest.php プロジェクト: aWEBoLabs/taxi
 /**
  * Prepopulate contents with results.
  */
 protected function setUp()
 {
     $this->expectedResults[0]['global_settings'] = array('text_processing' => 0, 'max_length' => '', 'allowed_values' => '', 'allowed_values_php' => '');
     $this->expectedResults[0]['db_columns'] = array('value' => array('type' => 'text', 'size' => 'big', 'not null' => '', 'sortable' => 1, 'views' => 1));
     $this->databaseContents['content_node_field'] = $this->expectedResults;
     $this->databaseContents['content_node_field'][0]['global_settings'] = serialize($this->databaseContents['content_node_field'][0]['global_settings']);
     $this->databaseContents['content_node_field'][0]['db_columns'] = serialize($this->databaseContents['content_node_field'][0]['db_columns']);
     $this->databaseContents['content_node_field_instance'][0]['widget_type'] = 'text_textarea';
     $this->databaseContents['content_node_field_instance'][0]['field_name'] = 'field_body';
     parent::setUp();
 }
コード例 #24
0
ファイル: FieldInstanceTest.php プロジェクト: scratch/gai
 /**
  * Prepopulate contents with results.
  */
 protected function setUp()
 {
     $this->expectedResults[0]['widget_settings'] = ['rows' => 5, 'size' => 60, 'default_value' => [['value' => '', '_error_element' => 'default_value_widget][field_body][0][value', 'default_value_php' => '']]];
     $this->expectedResults[0]['display_settings'] = ['label' => ['format' => 'above', 'exclude' => 0], 'teaser' => ['format' => 'default', 'exclude' => 0], 'full' => ['format' => 'default', 'exclude' => 0]];
     $this->databaseContents['content_node_field_instance'] = $this->expectedResults;
     $this->databaseContents['content_node_field_instance'][0]['widget_settings'] = serialize($this->expectedResults[0]['widget_settings']);
     $this->databaseContents['content_node_field_instance'][0]['display_settings'] = serialize($this->expectedResults[0]['display_settings']);
     $this->databaseContents['content_node_field_instance'][0]['global_settings'] = 'a:0:{}';
     $this->databaseContents['content_node_field'][0] = ['field_name' => 'field_body', 'required' => 1, 'type' => 'text', 'active' => 1, 'global_settings' => serialize([])];
     parent::setUp();
 }
コード例 #25
0
ファイル: CommentTestBase.php プロジェクト: aWEBoLabs/taxi
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         $this->databaseContents['comments'][$k] = $row;
         $this->databaseContents['comments'][$k]['status'] = 1 - $this->databaseContents['comments'][$k]['status'];
     }
     // Add node table data.
     $this->databaseContents['node'][] = array('nid' => 2, 'type' => 'story');
     $this->databaseContents['node'][] = array('nid' => 3, 'type' => 'page');
     parent::setUp();
 }
コード例 #26
0
ファイル: RoleTest.php プロジェクト: aWEBoLabs/taxi
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $row) {
         foreach ($row['permissions'] as $permission) {
             $this->databaseContents['role_permission'][] = array('permission' => $permission, 'rid' => $row['rid']);
         }
         unset($row['permissions']);
         $this->databaseContents['role'][] = $row;
     }
     parent::setUp();
 }
コード例 #27
0
ファイル: TermTestBase.php プロジェクト: ddrozdik/dmaps
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         foreach ($row['parent'] as $parent) {
             $this->databaseContents['term_hierarchy'][] = array('tid' => $row['tid'], 'parent' => $parent);
         }
         unset($row['parent']);
         $this->databaseContents['term_data'][$k] = $row;
     }
     parent::setUp();
 }
コード例 #28
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $k => $row) {
         foreach (array('isid', 'name', 'label') as $field) {
             $this->databaseContents['image_styles'][$k][$field] = $row[$field];
         }
         foreach ($row['effects'] as $id => $effect) {
             $row['effects'][$id]['data'] = serialize($row['effects'][$id]['data']);
         }
         $this->databaseContents['image_effects'] = $row['effects'];
     }
     parent::setUp();
 }
コード例 #29
0
ファイル: FilterFormatTest.php プロジェクト: sarahwillem/OD8
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     foreach ($this->expectedResults as $row) {
         foreach ($row['filters'] as $filter) {
             $filter['format'] = $row['format'];
             $filter['settings'] = serialize($filter['settings']);
             $this->databaseContents['filter'][] = $filter;
         }
         unset($row['filters']);
         $this->databaseContents['filter_format'][] = $row;
     }
     parent::setUp();
 }
コード例 #30
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->databaseContents['menu_links'] = $this->expectedResults;
     // Add long link title attributes.
     $title = $this->getRandomGenerator()->string('500');
     $this->databaseContents['menu_links'][0]['options']['attributes']['title'] = $title;
     $this->expectedResults[0]['description'] = Unicode::truncate($title, 255);
     // D6 menu link to a custom menu, provided by menu module.
     $this->databaseContents['menu_links'][] = ['menu_name' => 'menu-user', 'mlid' => 143, 'plid' => 0, 'link_path' => 'admin/build/menu-customize/navigation', 'router_path' => 'admin/build/menu-customize/%', 'link_title' => 'Navigation', 'options' => array(), 'module' => 'menu', 'hidden' => 0, 'external' => 0, 'has_children' => 0, 'expanded' => 0, 'weight' => 0, 'depth' => 0, 'customized' => 0, 'p1' => '0', 'p2' => '0', 'p3' => '0', 'p4' => '0', 'p5' => '0', 'p6' => '0', 'p7' => '0', 'p8' => '0', 'p9' => '0', 'updated' => '0', 'description' => ''];
     array_walk($this->databaseContents['menu_links'], function (&$row) {
         $row['options'] = serialize($row['options']);
     });
     parent::setUp();
 }