You are here

protected function ApiDocsAccessTest::setUp in Apigee API Catalog 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/ApiDocsAccessTest.php, line 57

Class

ApiDocsAccessTest
Tests the ApiDoc term access permissions.

Namespace

Drupal\Tests\apigee_api_catalog\Functional

Code

protected function setUp() {
  parent::setUp();

  // Add the system menu blocks to appropriate regions.
  $this
    ->setupMenus();

  // Create published apidoc.
  $apidoc_published = ApiDoc::create([
    'name' => 'API 1',
    'description' => 'Test API 1',
    'spec' => NULL,
    'status' => 1,
  ]);
  $apidoc_published
    ->save();
  $this->apidocPublished = $apidoc_published;

  // Create unpublished apidoc.
  $apidoc_unpublished = ApiDoc::create([
    'name' => 'API 2',
    'description' => 'Test API 2',
    'spec' => NULL,
    'status' => 0,
  ]);
  $apidoc_unpublished
    ->save();
  $this->apidocUnpublished = $apidoc_unpublished;
}