-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from paragonie/fix-psalm
Fix Psalm autoloading in Travis CI
- Loading branch information
Showing
6 changed files
with
69 additions
and
56 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
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,6 @@ | ||
<?php | ||
|
||
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase | ||
{ | ||
|
||
} |
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,14 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/psalm-autoload.php'; | ||
|
||
/** | ||
* This is necessary for PHPUnit on PHP >= 5.3 | ||
* | ||
* Class PHPUnit_Framework_TestCase | ||
*/ | ||
if (PHP_VERSION_ID >= 50300) { | ||
if (!class_exists('PHPUnit_Framework_TestCase')) { | ||
require_once __DIR__ . '/other/phpunit-shim.php'; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,31 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="true" | ||
backupStaticAttributes="false" | ||
bootstrap="lib/random.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
processIsolation="false" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
syntaxCheck="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Unit"> | ||
<directory>tests/unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
<testsuites> | ||
<testsuite name="Random Compat Test Suite"> | ||
<directory suffix="Test.php">./tests/unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./lib</directory> | ||
</whitelist> | ||
</filter> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="true" backupStaticAttributes="false" bootstrap="phpunit-autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" failOnRisky="true" failOnWarning="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./lib</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Random Compat Test Suite"> | ||
<directory suffix="Test.php">./tests/unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?php | ||
|
||
require_once 'lib/byte_safe_strings.php'; | ||
require_once 'lib/cast_to_int.php'; | ||
require_once 'lib/error_polyfill.php'; | ||
require_once 'other/ide_stubs/libsodium.php'; | ||
require_once 'lib/random.php'; | ||
require_once __DIR__ . '/lib/byte_safe_strings.php'; | ||
require_once __DIR__ . '/lib/cast_to_int.php'; | ||
require_once __DIR__ . '/lib/error_polyfill.php'; | ||
require_once __DIR__ . '/other/ide_stubs/libsodium.php'; | ||
require_once __DIR__ . '/lib/random.php'; | ||
|
||
$int = random_int(0, 65536); |
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 |
---|---|---|
@@ -1,28 +1,36 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
autoloader="psalm-autoload.php" | ||
useDocblockTypes="true" | ||
totallyTyped="true" | ||
autoloader="psalm-autoload.php" | ||
useDocblockTypes="true" | ||
totallyTyped="true" | ||
> | ||
<projectFiles> | ||
<directory name="lib" /> | ||
</projectFiles> | ||
<issueHandlers> | ||
<ReferenceConstraintViolation errorLevel="info" /> | ||
<!-- Type strictness surrounding /dev/urandom reads --> | ||
<RedundantConditionGivenDocblockType errorLevel="info" /> | ||
<!-- We have to be explicit because PHP 5 lacks scalar types --> | ||
<!-- We have to be explicit because PHP 5 lacks scalar types --> | ||
<DocblockTypeContradiction errorLevel="info" /> | ||
<!-- We're strict about runtime checks --> | ||
<DuplicateFunction errorLevel="info" /> | ||
<!-- We're a polyfill library! --> | ||
<UnresolvableInclude errorLevel="info" /> | ||
<!-- Because we put the variants into their own subdirectory --> | ||
<!-- Because we put the variants into their own subdirectory --> | ||
<DuplicateClass errorLevel="info" /> | ||
<!-- Later versions of Psalm are only PHP 7 compatible, which | ||
sees our redefinition of Error and TypeError as duplicate | ||
class errors. --> | ||
<!-- Later versions of Psalm are only PHP 7 compatible, which | ||
sees our redefinition of Error and TypeError as duplicate | ||
class errors. --> | ||
<UndefinedDocblockClass errorLevel="info" /> | ||
<!-- COM is Windows only --> | ||
<UndefinedConstant errorLevel="info" /> | ||
<!-- The Mcrypt constants aren't defined in PHP 7.2 --> | ||
<!-- The Mcrypt constants aren't defined in PHP 7.2 --> | ||
<MissingReturnType errorLevel="info" /> | ||
<!-- False positive with some versions of (Psalm, PHP) --> | ||
<!-- False positive with some versions of (Psalm, PHP) --> | ||
<InvalidReturnType errorLevel="info" /> | ||
<!-- The "last resort" function in lib/random.php --> | ||
<!-- The "last resort" function in lib/random.php --> | ||
<MixedInferredReturnType errorLevel="suppress" /> | ||
<!-- Only used in totallyTyped mode --> | ||
<!-- Only used in totallyTyped mode --> | ||
</issueHandlers> | ||
</psalm> |