Update Composer, update everything

This commit is contained in:
Oliver Davies 2018-11-23 12:29:20 +00:00
parent ea3e94409f
commit dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions

View file

@ -5,5 +5,5 @@ package: Testing
version: VERSION
core: 8.x
dependencies:
- tracker
- views
- drupal:tracker
- drupal:views

View file

@ -9,8 +9,8 @@ use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
use Drupal\Core\Session\AccountInterface;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\node\Entity\Node;
use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait;
/**
* Create and delete nodes and check for their display in the tracker listings.
@ -93,6 +93,7 @@ class TrackerTest extends BrowserTestBase {
$expected_tags = Cache::mergeTags($expected_tags, $role_tags);
$block_tags = [
'block_view',
'local_task',
'config:block.block.page_actions_block',
'config:block.block.page_tabs_block',
'config:block_list',
@ -179,6 +180,7 @@ class TrackerTest extends BrowserTestBase {
$expected_tags = Cache::mergeTags($expected_tags, $role_tags);
$block_tags = [
'block_view',
'local_task',
'config:block.block.page_actions_block',
'config:block.block.page_tabs_block',
'config:block_list',
@ -361,8 +363,14 @@ class TrackerTest extends BrowserTestBase {
];
$this->drupalPostForm('comment/reply/node/' . $nodes[3]->id() . '/comment', $comment, t('Save'));
// Start indexing backwards from node 3.
\Drupal::state()->set('tracker.index_nid', 3);
// Create an unpublished node.
$unpublished = $this->drupalCreateNode([
'title' => $this->randomMachineName(8),
'status' => 0,
]);
// Start indexing backwards from node 4.
\Drupal::state()->set('tracker.index_nid', 4);
// Clear the current tracker tables and rebuild them.
db_delete('tracker_node')

View file

@ -0,0 +1,69 @@
<?php
namespace Drupal\Tests\tracker\Functional\Views;
use Drupal\comment\Tests\CommentTestTrait;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Tests\views\Functional\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
use Drupal\comment\Entity\Comment;
/**
* Base class for all tracker tests.
*/
abstract class TrackerTestBase extends ViewTestBase {
use CommentTestTrait;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['comment', 'tracker', 'tracker_test_views'];
/**
* The node used for testing.
*
* @var \Drupal\node\NodeInterface
*/
protected $node;
/**
* The comment used for testing.
*
* @var \Drupal\comment\CommentInterface
*/
protected $comment;
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
ViewTestData::createTestViews(get_class($this), ['tracker_test_views']);
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Add a comment field.
$this->addDefaultCommentField('node', 'page');
$permissions = ['access comments', 'create page content', 'post comments', 'skip comment approval'];
$account = $this->drupalCreateUser($permissions);
$this->drupalLogin($account);
$this->node = $this->drupalCreateNode([
'title' => $this->randomMachineName(8),
'uid' => $account->id(),
'status' => 1,
]);
$this->comment = Comment::create([
'entity_id' => $this->node->id(),
'entity_type' => 'node',
'field_name' => 'comment',
'subject' => $this->randomMachineName(),
'comment_body[' . LanguageInterface::LANGCODE_NOT_SPECIFIED . '][0][value]' => $this->randomMachineName(20),
]);
}
}

View file

@ -0,0 +1,68 @@
<?php
namespace Drupal\Tests\tracker\Functional\Views;
use Drupal\views\Views;
/**
* Tests the tracker user uid handlers.
*
* @group tracker
*/
class TrackerUserUidTest extends TrackerTestBase {
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = ['test_tracker_user_uid'];
/**
* Tests the user uid filter and argument.
*/
public function testUserUid() {
$map = [
'nid' => 'nid',
'title' => 'title',
];
$expected = [
[
'nid' => $this->node->id(),
'title' => $this->node->label(),
],
];
$view = Views::getView('test_tracker_user_uid');
$this->executeView($view);
// We should have no results as the filter is set for uid 0.
$this->assertIdenticalResultSet($view, [], $map);
$view->destroy();
// Change the filter value to our user.
$view->initHandlers();
$view->filter['uid_touch_tracker']->value = $this->node->getOwnerId();
$this->executeView($view);
// We should have one result as the filter is set for the created user.
$this->assertIdenticalResultSet($view, $expected, $map);
$view->destroy();
// Remove the filter now, so only the argument will affect the query.
$view->removeHandler('default', 'filter', 'uid_touch_tracker');
// Test the incorrect argument UID.
$view->initHandlers();
$this->executeView($view, [rand()]);
$this->assertIdenticalResultSet($view, [], $map);
$view->destroy();
// Test the correct argument UID.
$view->initHandlers();
$this->executeView($view, [$this->node->getOwnerId()]);
$this->assertIdenticalResultSet($view, $expected, $map);
}
}

View file

@ -30,7 +30,7 @@ class TrackerNodeTest extends MigrateSqlSourceTestBase {
'nid' => '2',
'published' => '1',
'changed' => '1421727536',
]
],
];
// The expected results are identical to the source data.

View file

@ -31,7 +31,7 @@ class TrackerUserTest extends MigrateSqlSourceTestBase {
'uid' => '2',
'published' => '1',
'changed' => '1421727536',
]
],
];
// The expected results are identical to the source data.