pantheon_decoupled_profile-1.0.0-alpha1/tests/src/Functional/PantheonDecoupledProfileTest.php

tests/src/Functional/PantheonDecoupledProfileTest.php
<?php

use Behat\Mink\Exception\ExpectationException;
use Drupal\Tests\BrowserTestBase;

/**
 * Test to ensure that main page loads,
 * JSON API end-point works with menu items.
 *
 * @group pantheon_decoupled_profile
 */
class PantheonDecoupledProfileTest extends BrowserTestBase {

	/**
	 * Default profile to use.
	 *
	 * @var string
	 */
	protected $profile = 'pantheon_decoupled_profile';

	/**
	 * Test various configs for pantheon_decoupled_profile.
	 *
	 * @return void
	 * @throws ExpectationException
	 */
	public function testDecoupledProfileInstall() {
		// Test if front page loads.
		$this->drupalGet('<front>');
		$this->assertSession()->statusCodeEquals(200);
		$this->assertSession()->responseContains('This is an Example Article');

		// Test if JSON API endpoint is enabled.
		$this->drupalGet('/jsonapi');
		$this->assertSession()->statusCodeEquals(200);

		// Test if Menu items are available via json:api.
		$this->drupalGet('/jsonapi/menu_items/main');
		$this->assertSession()->statusCodeEquals(200);
	}

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc