Open Monograph Press  3.3.0
TestGatewayPluginTest.php
1 <?php
2 
14 import('lib.pkp.tests.WebTestCase');
15 
16 class TestGatewayFunctionalTest extends WebTestCase {
20  protected function getAffectedTables() {
21  return PKP_TEST_ENTIRE_DB;
22  }
23 
27  function testTestGateway() {
28  $this->open(self::$baseUrl);
29 
30  // Check that the gateway is not serving.
31  $this->open(self::$baseUrl . '/index.php/publicknowledge/gateway/plugin/TestGatewayPlugin');
32  $this->assertTextNotPresent('This request is being served by the test gateway plugin.');
33 
34  $this->logIn('admin', 'admin');
35  $this->waitForElementPresent($selector='link=Website');
36  $this->clickAndWait($selector);
37  $this->click('link=Plugins');
38 
39  // Find and enable the plugin
40  $this->waitForElementPresent($selector = '//input[@id=\'select-cell-TestGatewayPlugin-enabled\']');
41  $this->click($selector); // Enable plugin
42  $this->waitForElementPresent('//div[contains(text(),\'The plugin "Test Gateway Plugin" has been enabled.\')]');
43 
44  // Check that the gateway is not serving.
45  $this->open(self::$baseUrl . '/index.php/publicknowledge/gateway/plugin/TestGatewayPlugin');
46  $this->assertTextPresent('This request is being served by the test gateway plugin.');
47 
48  // Find the plugin's tab
49  $this->open(self::$baseUrl);
50  $this->logOut();
51  }
52 }
TestGatewayFunctionalTest
Functional tests for the test gateway plugin.
Definition: TestGatewayPluginTest.php:16
TestGatewayFunctionalTest\getAffectedTables
getAffectedTables()
Definition: TestGatewayPluginTest.php:20
TestGatewayFunctionalTest\testTestGateway
testTestGateway()
Definition: TestGatewayPluginTest.php:27