diff --git a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php index e5c2f40..3472c30 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php @@ -23,7 +23,7 @@ class SimpleTestBrowserTest extends WebTestBase { */ public static $modules = array('simpletest', 'test_page_test'); - function setUp() { + public function setUp() { parent::setUp(); // Create and log in an admin user. $this->drupalLogin($this->drupalCreateUser(array('administer unit tests'))); @@ -32,7 +32,7 @@ function setUp() { /** * Test the internal browsers functionality. */ - function testInternalBrowser() { + public function testInternalBrowser() { // Retrieve the test page and check its title and headers. $this->drupalGet('test-page'); $this->assertTrue($this->drupalGetHeader('Date'), 'An HTTP header was received.'); @@ -54,15 +54,16 @@ function testInternalBrowser() { $this->assertFalse($this->drupalGetHeader('Location'), 'Headers from intermediate request were reset.'); $this->assertResponse(200, 'Response code from intermediate request was reset.'); - // Test the maximum redirection option. $this->drupalLogout(); // Check that current user service updated to anonymous user. $this->assertEqual(0, $this->container->get('current_user')->id(), 'Current user service updated.'); + + // Test the maximum redirection option. + $this->maximumRedirects = 1; $edit = array( 'name' => $user->getUsername(), 'pass' => $user->pass_raw ); - $this->maximumRedirects = 1; $this->drupalPostForm('user', $edit, t('Log in'), array( 'query' => array('destination' => 'user/logout'), )); @@ -83,7 +84,7 @@ function testInternalBrowser() { /** * Test validation of the User-Agent header we use to perform test requests. */ - function testUserAgentValidation() { + public function testUserAgentValidation() { global $base_url; $system_path = $base_url . '/' . drupal_get_path('module', 'system'); $HTTP_path = $system_path .'/tests/http.php?q=node'; @@ -118,7 +119,7 @@ function testUserAgentValidation() { /** * Tests that PHPUnit and KernalTestBase tests work through the UI. */ - function testTestingThroughUI() { + public function testTestingThroughUI() { // We can not test WebTestBase tests here since they require a valid .htkey // to be created. However this scenario is covered by the testception of // \Drupal\simpletest\Tests\SimpleTestTest. diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php index fe67c7c..6f1d0e4 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -28,6 +28,8 @@ class SimpleTestTest extends WebTestBase { /** * The results array that has been parsed by getTestResults(). + * + * @var array */ protected $childTestResults; @@ -38,6 +40,19 @@ class SimpleTestTest extends WebTestBase { */ protected $test_ids = array(); + /** + * Translated fail message. + * + * @var string + */ + private $failMessage = ''; + + /** + * Translated pass message. + * @var string + */ + private $passMessage = ''; + function setUp() { if (!$this->isInChildSite()) { $php = <<<'EOD' @@ -148,6 +163,7 @@ function stubTest() { // This causes the second to fourth of the fifteen passes asserted in // confirmStubResults(). $user = $this->drupalCreateUser(array($this->valid_permission), 'SimpleTestTest'); + // This causes the fifth of the five fails asserted in confirmStubResults(). $this->drupalCreateUser(array($this->invalid_permission));