X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fmodules%2Fcontrib%2Ftoken%2Fsrc%2FTests%2FTokenBlockTest.php;fp=web%2Fmodules%2Fcontrib%2Ftoken%2Fsrc%2FTests%2FTokenBlockTest.php;h=55de3b98814d0b0da1bd3875a82cd465f66a9ca2;hb=059867c3f96750652c80f39e44c442a58c2549ee;hp=66e30255ec493d836143831f5adfde0010cd2c90;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2;p=yaffs-website diff --git a/web/modules/contrib/token/src/Tests/TokenBlockTest.php b/web/modules/contrib/token/src/Tests/TokenBlockTest.php index 66e30255e..55de3b988 100644 --- a/web/modules/contrib/token/src/Tests/TokenBlockTest.php +++ b/web/modules/contrib/token/src/Tests/TokenBlockTest.php @@ -1,6 +1,7 @@ admin_user = $this->drupalCreateUser(array('access content', 'administer blocks')); + $this->admin_user = $this->drupalCreateUser(['access content', 'administer blocks']); $this->drupalLogin($this->admin_user); } public function testBlockTitleTokens() { $label = 'tokenblock'; - $bundle = BlockContentType::create(array( + $bundle = BlockContentType::create([ 'id' => $label, 'label' => $label, 'revision' => FALSE - )); + ]); $bundle->save(); - $block_content = BlockContent::create(array( + $block_content = BlockContent::create([ 'type' => $label, 'label' => '[current-page:title] block title', 'info' => 'Test token title block', 'body[value]' => 'This is the test token title block.', - )); + ]); $block_content->save(); - $block = $this->drupalPlaceBlock('block_content:' . $block_content->uuid(), array( + $block = $this->drupalPlaceBlock('block_content:' . $block_content->uuid(), [ 'label' => '[user:name]', - )); - $this->drupalGet($block->urlInfo()); + ]); + $this->drupalGet($block->toUrl()); // Ensure that the link to available tokens is present and correctly // positioned. $this->assertLink('Browse available tokens.'); $this->assertText('This field supports tokens. Browse available tokens.'); - $this->drupalPostForm(NULL, array(), t('Save block')); + $this->drupalPostForm(NULL, [], t('Save block')); // Ensure token validation is working on the block. $this->assertText('Title is using the following invalid tokens: [user:name].'); @@ -63,8 +64,8 @@ class TokenBlockTest extends TokenTestBase { $block->save(); // Ensure that tokens are not double-escaped when output as a block title. - $this->drupalCreateContentType(array('type' => 'page')); - $node = $this->drupalCreateNode(array('title' => "Site's first node")); + $this->drupalCreateContentType(['type' => 'page']); + $node = $this->drupalCreateNode(['title' => "Site's first node"]); $this->drupalGet('node/' . $node->id()); // The apostraphe should only be escaped once. $this->assertRaw("Site's first node block title");