Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
deae7fc
chore: replace expect deprecation with expectException
yenfryherrerafeliz Jan 20, 2026
3f29272
chore: make data provider static functions
yenfryherrerafeliz Jan 20, 2026
ef91a51
chore: enhance data providers
yenfryherrerafeliz Jan 26, 2026
8b52ce7
chore: replace deprecated expect methods
yenfryherrerafeliz Jan 26, 2026
641e45a
chore: update essential files
yenfryherrerafeliz Jan 27, 2026
bb88223
chore: minor fixes
yenfryherrerafeliz Jan 28, 2026
1302689
chore: update phpunit version requirement
yenfryherrerafeliz Jan 28, 2026
648bde1
chore: assert true on cover nothing test
yenfryherrerafeliz Jan 28, 2026
664108c
fix: missing breakline symbol
yenfryherrerafeliz Jan 28, 2026
3141e83
chore: fixed multiple warnings and errors
yenfryherrerafeliz Jan 29, 2026
063e1c3
fix: code duplication
yenfryherrerafeliz Jan 30, 2026
ac41a42
chore: bulk tests fix
yenfryherrerafeliz Jan 30, 2026
0927f79
fix: format issues
yenfryherrerafeliz Jan 30, 2026
dac8a36
fix: format issues v2
yenfryherrerafeliz Jan 30, 2026
e1fb202
fix: format issues v3
yenfryherrerafeliz Jan 30, 2026
6a3c601
fix: format issues v4
yenfryherrerafeliz Jan 30, 2026
a0812f2
chore: remove XDEBUG_MODE
yenfryherrerafeliz Jan 30, 2026
d83228e
chore: skip tests coverage report
yenfryherrerafeliz Jan 30, 2026
9c0eb84
fix: remove call to removed method
yenfryherrerafeliz Jan 30, 2026
b8d4c9b
chore: replace CoversNothing with DoesNotPerformAssertions
yenfryherrerafeliz Feb 23, 2026
4992e3f
feat: keep coverage
yenfryherrerafeliz Feb 23, 2026
e182b6d
chore: addresses minor misses
yenfryherrerafeliz Feb 24, 2026
ccc634a
chore: fix doc annotations aligments
yenfryherrerafeliz Feb 24, 2026
3e27584
chore: remove wrongly DoesNotPerformAssertions
yenfryherrerafeliz Feb 24, 2026
72b4ae9
chore: remove coverage on test runs
yenfryherrerafeliz Feb 24, 2026
5b56b56
chore: merge branch 'master' into chore_php_unit_10
yenfryherrerafeliz Mar 10, 2026
ac08ec7
chore: changelog entry
yenfryherrerafeliz Mar 10, 2026
affac9d
chore: update integ tests
yenfryherrerafeliz Mar 11, 2026
120b5df
chore: revert behat version
yenfryherrerafeliz Mar 11, 2026
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
7 changes: 7 additions & 0 deletions .changes/nextrelease/chore-phpunit-10-support.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"type": "enhancement",
"category": "",
"description": "Add support for PHPUnit v10. \n- Make data provider static functions. \n- Use class attributes instead of annotations for @dataProvider, @covers, and @doesNotPerformAssertions. \n- Remove/Replace the usage of expectDeprecation, expectDeprecationMessage, expectDeprecationMessageMatches, expectError, expectErrorMessage, expectNotice, expectNoticeMessage, expectWarning, and expectWarningMessage. \n- Migrate phpunit xml config file."
}
]
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
composer update ${{ matrix.composer-options }} --no-interaction --prefer-dist --with-all-dependencies
composer update psr/http-message guzzlehttp/psr7 guzzlehttp/guzzle --with-all-dependencies --no-interaction
if [[ "${{ matrix.php-versions }}" == "8.4" ]]; then
composer update phpunit/phpunit:^9.6.18 --with-all-dependencies --no-interaction
composer update phpunit/phpunit:^10.0 --with-all-dependencies --no-interaction
fi
else
composer update ${{ matrix.composer-options }} --no-interaction --prefer-dist --with-all-dependencies
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ clear-cache:
php build/aws-clear-cache.php

test:
@AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar AWS_SESSION_TOKEN= AWS_CSM_ENABLED=false AWS_REGION= AWS_ENDPOINT_URL= AWS_SUPPRESS_PHP_DEPRECATION_WARNING=true \
vendor/bin/phpunit --testsuite=unit $(TEST)
AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar AWS_SESSION_TOKEN= \
AWS_CSM_ENABLED=false \
AWS_REGION= \
AWS_ENDPOINT_URL= \
AWS_SUPPRESS_PHP_DEPRECATION_WARNING=true \
vendor/bin/phpunit --no-coverage --testsuite=unit $(TEST)

test-phar: package
[ -f build/artifacts/behat.phar ] || (cd build/artifacts && \
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"ext-openssl": "*",
"ext-dom": "*",
"ext-sockets": "*",
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^10.0",
"behat/behat": "~3.0",
"doctrine/cache": "~1.4",
"aws/aws-php-sns-message-validator": "~1.0",
Expand All @@ -42,7 +42,7 @@
"psr/simple-cache": "^2.0 || ^3.0",
"sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0",
"yoast/phpunit-polyfills": "^2.0",
"dms/phpunit-arraysubset-asserts": "^0.4.0"
"dms/phpunit-arraysubset-asserts": "^v0.5.0"
},
"suggest": {
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
Expand Down
12 changes: 4 additions & 8 deletions features/bootstrap/Aws/Test/Integ/BatchingContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@
use Aws\Sqs\SqsClient;
use Behat\Behat\Hook\Scope\AfterFeatureScope;
use Behat\Behat\Hook\Scope\BeforeFeatureScope;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use PHPUnit\Framework\Assert;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class BatchingContext extends TestCase implements
class BatchingContext implements
Context,
SnippetAcceptingContext
{
Expand Down Expand Up @@ -163,15 +159,15 @@ public function itemsShouldHaveBeenWritten($itemCount)
'TableName' => self::$resource,
]);

$this->assertSame((int) $itemCount, iterator_count($actualItems));
Assert::assertSame((int) $itemCount, iterator_count($actualItems));
}

/**
* @Then /^the batch should have been flushed at least (\d+) times$/
*/
public function theBatchShouldHaveBeenFlushedTimes($flushCount)
{
$this->assertGreaterThanOrEqual((int) $flushCount, $this->flushCount);
Assert::assertGreaterThanOrEqual((int) $flushCount, $this->flushCount);
}

/**
Expand Down Expand Up @@ -230,6 +226,6 @@ public function messagesShouldHaveBeenDeletedFromTheQueue($messageCount)
? count($this->response['Successful'])
: 0;

$this->assertSame((int) $messageCount, $failedCount + $successfulCount);
Assert::assertSame((int) $messageCount, $failedCount + $successfulCount);
}
}
11 changes: 3 additions & 8 deletions features/bootstrap/Aws/Test/Integ/BlockingContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@

use Aws\AwsClient;
use Aws\DynamoDb\Exception\DynamoDbException;
use Behat\Behat\Hook\Scope\AfterFeatureScope;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Promise;
use PHPUnit\Framework\Assert;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* Defines application features from the specific context.
*/
class BlockingContext extends TestCase implements Context, SnippetAcceptingContext
class BlockingContext implements Context, SnippetAcceptingContext
{
use IntegUtils;

Expand Down Expand Up @@ -101,9 +96,9 @@ public function theTableNamedWillNotExist($table)
{
try {
$this->theTableNamedWillExist($table);
$this->fail("$table exists but should not.");
Assert::fail("$table exists but should not.");
} catch (DynamoDbException $e) {
$this->assertSame('ResourceNotFoundException', $e->getAwsErrorCode());
Assert::assertSame('ResourceNotFoundException', $e->getAwsErrorCode());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\Assert;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class ClientSideMonitoringContext extends TestCase
class ClientSideMonitoringContext
implements Context, SnippetAcceptingContext
{

Expand Down Expand Up @@ -271,19 +270,19 @@ private function clearAndSetEnv($env)

private function compareMonitoringEvents($expected, $actual)
{
$this->assertSame(count($expected), count($actual));
Assert::assertSame(count($expected), count($actual));
foreach ($expected as $index => $expectedEvent) {
$actualEvent = $actual[$index];
foreach ($expectedEvent as $key => $value) {
$this->assertArrayHasKey($key, $actualEvent);
Assert::assertArrayHasKey($key, $actualEvent);
$this->validateEventValue($value, $actualEvent[$key]);
}
$allowedFields = array_merge(
array_keys($expectedEvent),
array_keys($this->testData['defaults']['optionalEventFields'][$actualEvent['Type']])
);
foreach ($actualEvent as $key => $value) {
$this->assertTrue(in_array($key, $allowedFields));
Assert::assertTrue(in_array($key, $allowedFields));
if (in_array($key, $this->testData['defaults']['optionalEventFields'][$actualEvent['Type']])) {
$this->validateEventValue(
$this->testData['defaults']['optionalEventFields'][$actualEvent['Type']],
Expand Down Expand Up @@ -437,13 +436,13 @@ private function validateEventValue($expected, $actual)
{
switch ($expected) {
case "ANY_INT":
$this->assertIsInt($actual);
Assert::assertIsInt($actual);
break;
case "ANY_STR":
$this->assertIsString('string', $actual);
Assert::assertIsString('string', $actual);
break;
default:
$this->assertEquals($expected, $actual);
Assert::assertEquals($expected, $actual);
}
}
}
17 changes: 8 additions & 9 deletions features/bootstrap/Aws/Test/Integ/ConcurrencyContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,22 @@

use Aws\CommandInterface;
use Aws\CommandPool;
use Aws\Exception\AwsException;
use Aws\Result;
use Aws\S3\S3Client;
use Behat\Behat\Hook\Scope\AfterFeatureScope;
use Behat\Behat\Hook\Scope\BeforeFeatureScope;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Promise;
use GuzzleHttp\Promise\PromiseInterface;
use JmesPath;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;

/**
* Defines application features from the specific context.
*/
class ConcurrencyContext extends TestCase implements
class ConcurrencyContext implements
Context,
SnippetAcceptingContext
{
Expand Down Expand Up @@ -93,9 +89,12 @@ public function iCallTheApi($command)
*/
public function theValueAtShouldBeA($key, $type)
{
$this->assertInstanceOf(Result::class, $this->result);
Assert::assertInstanceOf(Result::class, $this->result);
$methodName = 'assertIs' . ucfirst($type);
$this->$methodName($this->result->search($key));
call_user_func(
[Assert::class, $methodName],
$this->result->search($key)
);
}

/**
Expand Down Expand Up @@ -161,15 +160,15 @@ public function iSendTheCommandsAsABatchTo($service)
*/
public function thereShouldBeResults($count)
{
$this->assertCount((int) $count, $this->result);
Assert::assertCount((int) $count, $this->result);
}

/**
* @Then there should be :count value at :path
*/
public function thereShouldBeValueAt($count, $path)
{
$this->assertCount((int) $count, array_unique(
Assert::assertCount((int) $count, array_unique(
JmesPath\search($path, $this->result)
));
}
Expand Down
3 changes: 0 additions & 3 deletions features/bootstrap/Aws/Test/Integ/MultipartContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
use Aws\S3\MultipartCopy;
use Aws\S3\MultipartUploader as S3MultipartUploader;
use Aws\S3\S3Client;
use Behat\Behat\Tester\Exception\PendingException;
use Aws\S3\BatchDelete;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\NoSeekStream;
use PHPUnit\Framework\Assert;
Expand Down
20 changes: 8 additions & 12 deletions features/bootstrap/Aws/Test/Integ/NativeStreamContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
use Aws\S3\S3Client;
use Behat\Behat\Hook\Scope\AfterFeatureScope;
use Behat\Behat\Hook\Scope\BeforeFeatureScope;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;

/**
* Defines application features from the specific context.
*/
class NativeStreamContext extends TestCase implements
class NativeStreamContext implements
Context,
SnippetAcceptingContext
{
Expand Down Expand Up @@ -108,7 +104,7 @@ public function iCallOnThePath($method, $path)
*/
public function theCallShouldReturn($booleanString)
{
$this->assertSame(
Assert::assertSame(
filter_var($booleanString, FILTER_VALIDATE_BOOLEAN),
$this->callSucceeded
);
Expand All @@ -119,7 +115,7 @@ public function theCallShouldReturn($booleanString)
*/
public function iHaveAFileAtWithTheContent($path, $contents)
{
$this->assertGreaterThan(
Assert::assertGreaterThan(
0,
file_put_contents($this->getS3Path($path), $contents)
);
Expand All @@ -130,15 +126,15 @@ public function iHaveAFileAtWithTheContent($path, $contents)
*/
public function iHaveAFileAtWithNoContent($path)
{
$this->assertSame(0, file_put_contents($this->getS3Path($path), ''));
Assert::assertSame(0, file_put_contents($this->getS3Path($path), ''));
}

/**
* @Then the file at :arg1 should contain :arg2
*/
public function theFileAtShouldContain($key, $contents)
{
$this->assertStringEqualsFile($this->getS3Path($key), $contents);
Assert::assertStringEqualsFile($this->getS3Path($key), $contents);
}

/**
Expand All @@ -154,23 +150,23 @@ public function iHaveAReadHandleOnTheFileAt($key)
*/
public function readingBytesShouldReturn($byteCount, $expected)
{
$this->assertSame($expected, fread($this->handle, $byteCount));
Assert::assertSame($expected, fread($this->handle, $byteCount));
}

/**
* @Then /^calling fstat should report a size of (\d+)$/
*/
public function callingFstatShouldReportASizeOf($size)
{
$this->assertSame((int) $size, fstat($this->handle)['size']);
Assert::assertSame((int) $size, fstat($this->handle)['size']);
}

/**
* @Then scanning the directory at :dir should return a list with one member named :file
*/
public function scanningTheDirectoryAtShouldReturnAListWithOneMemberNamed($dir, $file)
{
$this->assertSame([$file], scandir($this->getS3Path($dir)));
Assert::assertSame([$file], scandir($this->getS3Path($dir)));
}

private function getS3Path($path)
Expand Down
2 changes: 0 additions & 2 deletions features/bootstrap/Aws/Test/Integ/S3Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
use Aws\Sts\StsClient;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Aws\S3\S3Client;
use Aws\S3\PostObject;
use Aws\S3\PostObjectV4;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Behat\Tester\Exception\PendingException;
use Aws\Crypto\AbstractCryptoClient;
use Aws\Kms\KmsClient;
use PHPUnit\Framework\Assert;
Expand Down
Loading
Loading