-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing: Check markup for errors in visitAdminPage
- Loading branch information
Showing
5 changed files
with
26 additions
and
18 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,22 @@ | ||
/** | ||
* Regular expression matching a displayed PHP error within a markup string. | ||
* | ||
* @link https://github.com/php/php-src/blob/598175e/main/main.c#L1257-L1297 | ||
* | ||
* @type RegExp | ||
*/ | ||
const REGEXP_PHP_ERROR = /<b>(Fatal error|Recoverable fatal error|Warning|Parse error|Notice|Strict Standards|Deprecated|Unknown error)<\/b>/; | ||
|
||
/** | ||
* Returns a promise resolving to a boolean reflecting whether a PHP notice is | ||
* present anywhere within the document's markup. This requires the environment | ||
* be configured to display errors. | ||
* | ||
* @link http://php.net/manual/en/function.error-reporting.php | ||
* | ||
* @return {Promise} Promise resolving to a boolean reflecting whether a PHP | ||
* notice is present. | ||
*/ | ||
export async function hasPHPError() { | ||
return REGEXP_PHP_ERROR.test( await page.content() ); | ||
} |
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
This file was deleted.
Oops, something went wrong.
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
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