VapnFunctionalTest.php in View access per node 8        
                          
                  
                        
  
  
  
  
  
File
  tests/src/Functional/VapnFunctionalTest.php
  
    View source  
  <?php
namespace Drupal\Tests\vapn\Functional;
use Drupal\Tests\BrowserTestBase;
class VapnFunctionalTest extends BrowserTestBase {
  
  public static $modules = [
    'vapn',
    'node',
  ];
  
  protected $user;
  protected $strictConfigSchema = FALSE;
  
  protected function setUp() {
    parent::setUp();
    $permissions = [
      'administer site configuration',
      'access administration pages',
      'use vapn',
      'bypass node access',
    ];
    $this->user = $this
      ->drupalCreateUser($permissions);
    $this
      ->drupalLogin($this->user);
  }
  
  public function testConfigForm() {
    $this
      ->drupalCreateContentType([
      'type' => 'page',
    ]);
    $this->editForm = 'admin/config/vapn/vapnconfig';
    $form = [
      'vapn_node_list[page]' => 1,
    ];
    $this
      ->drupalPostForm($this->editForm, $form, t('Save configuration'));
    $this
      ->drupalGet('node/add/page');
    $this
      ->assertSession()
      ->elementExists('css', '#edit-vapn');
  }
}