Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Nov 13, 2023
1 parent 920d249 commit d19afde
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 48 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/vendor
/bin
/composer.lock
/tests/.phpunit.result.cache
/tests/config.neon
/temp

2 changes: 0 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@
passthru="true"
checkreturn="true"
>
<arg value="-c"/>
<arg value="tests/phpunit.xml"/>
<arg path="tests"/>
</exec>
</target>
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@
"psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0",
"react/event-loop": "^1.3.0",
"react/promise": "^2.9.0",
"react/promise-timer": "^1.10.0",
"react/socket": "^1.12.0"
},
"require-dev": {
"ext-imap": "*",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phing/phing": "^2.17.4",
"phpstan/phpstan": "^1.9.14",
"phpstan/phpstan": "^1.10.41",
"phpstan/phpstan-phpunit": "^1.3.3",
"phpstan/phpstan-strict-rules": "^1.4.5",
"phpunit/phpunit": "^9.5.28",
"phpunit/phpunit": "^10.4.2",
"slevomat/coding-standard": "^8.8",
"spell-checker/spell-checker": "^0.3.22",
"spell-checker/dictionary-en": "^0.1.1",
Expand Down
3 changes: 0 additions & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@
<element value="
@phpcsSuppress,
"/>
<element value="
@dataProvider,
"/>
<element value="
@deprecated,
@internal,
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ includes:
parameters:
ignoreErrors:
- '#should return React\\Promise\\ExtendedPromiseInterface but returns React\\Promise\\PromiseInterface#'
- '#should be covariant with return type \(React\\Promise\\PromiseInterface#'

# ignored strict rules
- '#Dynamic call to static method#'
Expand Down
28 changes: 28 additions & 0 deletions phpunit.dist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
bootstrap="./tests/bootstrap.php"
colors="true"
failOnRisky="true"
failOnWarning="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
cacheDirectory="./temp/.phpunit.cache"
beStrictAboutCoverageMetadata="true"
>
<testsuite name="default">
<directory suffix="Test.php">./tests</directory>
</testsuite>
<coverage>
<report>
<clover outputFile="./temp/clover.xml"/>
<text outputFile="php://stdout" showUncoveredFiles="true" showOnlySummary="true"/>
</report>
</coverage>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/AsyncMessageQueueManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AsyncMessageQueueManagerTest extends TestCase

private LoopInterface $loop;

/** @var array<string, bool|string> */
/** @var array<string, bool|Throwable> */
private array $exceptions = [];

private int $disconnectsCount = 0;
Expand Down
19 changes: 11 additions & 8 deletions tests/Smtp/AsyncSmtpConnectionWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Closure;
use Exception;
use Nette\Mail\Message;
use PHPUnit\Framework\Attributes\DataProvider;
use Psr\Log\LoggerInterface;
use React\EventLoop\Factory;
use React\EventLoop\LoopInterface;
Expand Down Expand Up @@ -124,7 +125,10 @@ function (Throwable $exception): void {
);
}

public function dataSuccessfulWrites(): array
/**
* @return list<array{0: AsyncDoubleResponseMessage, 1: string, 2?: string}>
*/
public static function dataSuccessfulWrites(): array
{
return [
[
Expand Down Expand Up @@ -168,9 +172,7 @@ public function dataSuccessfulWrites(): array
];
}

/**
* @dataProvider dataSuccessfulWrites
*/
#[DataProvider('dataSuccessfulWrites')]
public function testSuccessfulWrites(
AsyncMessage $message,
?string $actualFirstResponse = null,
Expand All @@ -193,7 +195,10 @@ function (Throwable $exception): void {
);
}

public function dataFailedWrites(): array
/**
* @return list<array{0: AsyncDoubleResponseMessage, 1: string, 2: string|null, 3: string}>
*/
public static function dataFailedWrites(): array
{
return [
//invalid first response
Expand Down Expand Up @@ -232,9 +237,7 @@ public function dataFailedWrites(): array
];
}

/**
* @dataProvider dataFailedWrites
*/
#[DataProvider('dataFailedWrites')]
public function testFailedWrites(
AsyncMessage $message,
?string $actualFirstResponse = null,
Expand Down
10 changes: 6 additions & 4 deletions tests/Smtp/AsyncSmtpMessageSenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use AsyncConnection\TestCase;
use Closure;
use Nette\Utils\Strings;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use React\EventLoop\Factory;
use React\EventLoop\LoopInterface;
Expand Down Expand Up @@ -45,7 +46,10 @@ public function testSuccessfulSendingReturnsPromise(): void
$this->runSuccessfulSendingTest($this->createMessage());
}

public function dataFailedSendingThrowsException(): array
/**
* @return list<array{0: string}>
*/
public static function dataFailedSendingThrowsException(): array
{
return [
['MAIL FROM:<[email protected]>'],
Expand All @@ -56,9 +60,7 @@ public function dataFailedSendingThrowsException(): array
];
}

/**
* @dataProvider dataFailedSendingThrowsException
*/
#[DataProvider('dataFailedSendingThrowsException')]
public function testFailedSendingThrowsException(string $messageToFail): void
{
$this->writerMock->method('write')
Expand Down
27 changes: 0 additions & 27 deletions tests/phpunit.xml

This file was deleted.

0 comments on commit d19afde

Please sign in to comment.