-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #3113463 by mtift: Add some tests
- Loading branch information
Showing
3 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Drupal\Tests\npr_api\Functional; | ||
|
||
use Drupal\Tests\BrowserTestBase; | ||
|
||
/** | ||
* Test the NPR API Settings form. | ||
* | ||
* @group npr | ||
*/ | ||
class NprApiSettingsTest extends BrowserTestBase { | ||
|
||
/** | ||
* Modules to enable. | ||
* | ||
* @var array | ||
*/ | ||
public static $modules = ['npr_api']; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected $defaultTheme = 'stark'; | ||
|
||
/** | ||
* An admin user with permission to administer the NPR API. | ||
* | ||
* @var \Drupal\user\UserInterface | ||
*/ | ||
protected $adminUser; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function setUp() { | ||
parent::setUp(); | ||
|
||
$this->adminUser = $this->drupalCreateUser([ | ||
'administer npr api', | ||
]); | ||
} | ||
|
||
/** | ||
* Test the NPR API Settings form. | ||
*/ | ||
public function testNprApiSettingsForm() { | ||
|
||
// Login as as an admin user. | ||
$this->drupalLogin($this->adminUser); | ||
|
||
// Make sure the option exists to select a story node. | ||
$this->drupalGet('admin/config/services/npr/api_config'); | ||
$this->assertSession()->statusCodeEquals(200); | ||
$this->assertSession()->pageTextContains('NPR API production URL'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ package: NPR | |
type: module | ||
configure: npr_story.config_form | ||
dependencies: | ||
- drupal:media | ||
- npr:npr_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters