コード例 #1
0
 /**
  * Sets the test up.
  */
 protected function setUp()
 {
     parent::setUp();
     /** @var UserInterface $user */
     $user = User::load(1);
     // Create initial block.
     $block = $this->createBlockContent('initial');
     $blocks = array();
     $logs = array();
     // Get original block.
     $blocks[] = $block->getRevisionId();
     $logs[] = '';
     // Create three revisions.
     $revision_count = 3;
     for ($i = 0; $i < $revision_count; $i++) {
         $block->setNewRevision(TRUE);
         $block->setRevisionLogMessage($this->randomMachineName(32));
         $block->setRevisionUser($this->adminUser);
         $block->setRevisionCreationTime(REQUEST_TIME);
         $logs[] = $block->getRevisionLogMessage();
         $block->save();
         $blocks[] = $block->getRevisionId();
     }
     $this->blocks = $blocks;
     $this->revisionLogs = $logs;
 }
コード例 #2
0
 /**
  * Sets the test up.
  */
 protected function setUp()
 {
     parent::setUp();
     // Create initial block.
     $block = $this->createBlockContent('initial');
     $blocks = array();
     $logs = array();
     // Get original block.
     $blocks[] = $block->getRevisionId();
     $logs[] = '';
     // Create three revisions.
     $revision_count = 3;
     for ($i = 0; $i < $revision_count; $i++) {
         $block->setNewRevision(TRUE);
         $block->setRevisionLog($this->randomMachineName(32));
         $logs[] = $block->getRevisionLog();
         $block->save();
         $blocks[] = $block->getRevisionId();
     }
     $this->blocks = $blocks;
     $this->revisionLogs = $logs;
 }
コード例 #3
0
 protected function setUp()
 {
     parent::setUp();
     $this->drupalPlaceBlock('page_title_block');
 }
コード例 #4
0
 /**
  * Sets the test up.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
 }