InstagramBlockUpdatePathTest.php in Instagram Block 8.3
File
src/Tests/Update/InstagramBlockUpdatePathTest.php
View source
<?php
namespace Drupal\instagram_block\Tests\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Drupal\block\Entity\Block;
class InstagramBlockUpdatePathTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../tests/fixtures/update/drupal-8.instagram-block-2778667.site-with-instagram-block.php.gz',
__DIR__ . '/../../../tests/fixtures/update/drupal-8.instagram-block-2778667.add-block.php',
];
}
public function testUpdateMoveAccessTokens() {
$block_before = Block::load('testaccesstokenmove');
$settings = $block_before
->get('settings');
$this
->assertTrue(!isset($settings['access_token']), 'No access token setting on block before update.');
$this
->runUpdates();
$block_after = Block::load('testaccesstokenmove');
$access_token = $block_after
->get('settings')['access_token'];
$this
->assertEquals($access_token, '412345678.123ab45.cde678fg901h234ij567klm89nop0123', 'Access token copied to block successfully.');
}
}