Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 3.0.1 into 3.1.x #118

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/vendor
/composer.lock
/phpunit.xml
/.phpunit.result.cache
/.phpunit.cache
/phpcs.xml
/.phpcs-cache
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"require-dev": {
"doctrine/coding-standard": "^12",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^10.5",
"psalm/plugin-phpunit": "^0.18.3",
"vimeo/psalm": "^5.21"
},
Expand Down
14 changes: 7 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
convertNoticesToExceptions="true"
cacheDirectory=".phpunit.cache"
>
<php>
<ini name="error_reporting" value="-1" />
<ini name="error_reporting" value="-1" />
</php>

<testsuites>
Expand All @@ -18,9 +18,9 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<source>
<include>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</include>
</source>
</phpunit>
6 changes: 6 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<file name="src/Token.php" />
</errorLevel>
</MixedReturnStatement>
<PossiblyUnusedMethod>
<errorLevel type="suppress">
<!-- https://github.com/psalm/psalm-plugin-phpunit/issues/131 -->
<file name="tests/AbstractLexerTest.php" />
</errorLevel>
</PossiblyUnusedMethod>
<PossiblyUnusedProperty>
<errorLevel type="suppress">
<!-- TODO: Cover this property in a test -->
Expand Down
38 changes: 12 additions & 26 deletions tests/AbstractLexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\Tests\Common\Lexer;

use Doctrine\Common\Lexer\Token;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

use function array_map;
Expand Down Expand Up @@ -82,11 +83,8 @@ public function testResetPosition(): void
$this->assertEquals($expectedTokens[0], $this->concreteLexer->lookahead);
}

/**
* @psalm-param list<Token<string, string|int>> $expectedTokens
*
* @dataProvider dataProvider
*/
/** @psalm-param list<Token<string, string|int>> $expectedTokens */
#[DataProvider('dataProvider')]
public function testMoveNext(string $input, array $expectedTokens): void
{
$this->concreteLexer->setInput($input);
Expand Down Expand Up @@ -126,11 +124,8 @@ public function testUtf8Mismatch(): void
);
}

/**
* @psalm-param list<Token<string, string|int>> $expectedTokens
*
* @dataProvider dataProvider
*/
/** @psalm-param list<Token<string, string|int>> $expectedTokens */
#[DataProvider('dataProvider')]
public function testPeek(string $input, array $expectedTokens): void
{
$this->concreteLexer->setInput($input);
Expand All @@ -146,11 +141,8 @@ public function testPeek(string $input, array $expectedTokens): void
$this->assertNull($this->concreteLexer->peek());
}

/**
* @psalm-param list<Token<string, string|int>> $expectedTokens
*
* @dataProvider dataProvider
*/
/** @psalm-param list<Token<string, string|int>> $expectedTokens */
#[DataProvider('dataProvider')]
public function testGlimpse(string $input, array $expectedTokens): void
{
$this->concreteLexer->setInput($input);
Expand All @@ -177,7 +169,7 @@ public static function inputUntilPositionDataProvider(): array
];
}

/** @dataProvider inputUntilPositionDataProvider */
#[DataProvider('inputUntilPositionDataProvider')]
public function testGetInputUntilPosition(
string $input,
int $position,
Expand All @@ -188,11 +180,8 @@ public function testGetInputUntilPosition(
$this->assertSame($expectedInput, $this->concreteLexer->getInputUntilPosition($position));
}

/**
* @psalm-param list<Token<string, string|int>> $expectedTokens
*
* @dataProvider dataProvider
*/
/** @psalm-param list<Token<string, string|int>> $expectedTokens */
#[DataProvider('dataProvider')]
public function testIsNextToken(string $input, array $expectedTokens): void
{
$this->concreteLexer->setInput($input);
Expand All @@ -205,11 +194,8 @@ public function testIsNextToken(string $input, array $expectedTokens): void
}
}

/**
* @psalm-param list<Token<string, string|int>> $expectedTokens
*
* @dataProvider dataProvider
*/
/** @psalm-param list<Token<string, string|int>> $expectedTokens */
#[DataProvider('dataProvider')]
public function testIsNextTokenAny(string $input, array $expectedTokens): void
{
$allTokenTypes = array_map(static function ($token): string {
Expand Down
Loading