Skip to content

Commit

Permalink
Replace PHPUnitCompatTrait with packages yoast/phpunit-polyfills and …
Browse files Browse the repository at this point in the history
…dms/phpunit-arraysubset-asserts
  • Loading branch information
Zombaya committed Aug 11, 2022
1 parent e98701e commit 7237709
Show file tree
Hide file tree
Showing 143 changed files with 249 additions and 1,124 deletions.
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"ext-pcre": "*",
"ext-json": "*",
"ext-simplexml": "*",
"aws/aws-crt-php": "^1.0.2"
"aws/aws-crt-php": "^1.0.2",
"dms/phpunit-arraysubset-asserts": "^0.4.0"
},
"require-dev": {
"composer/composer" : "^1.10.22",
Expand All @@ -41,7 +42,8 @@
"psr/cache": "^1.0",
"psr/simple-cache": "^1.0",
"paragonie/random_compat": ">= 2",
"sebastian/comparator": "^1.2.3 || ^4.0"
"sebastian/comparator": "^1.2.3 || ^4.0",
"yoast/phpunit-polyfills": "^1.0"
},
"suggest": {
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
Expand Down
5 changes: 1 addition & 4 deletions tests/AbstractConfigurationProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
use Aws\LruArrayCache;
use Aws\Result;
use Aws\ResultInterface;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use GuzzleHttp\Promise;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\AbstractConfigurationProvider
*/
class AbstractConfigurationProviderTest extends TestCase
{
use PHPUnitCompatTrait;

/** @var \PHPUnit_Framework_MockObject_MockObject */
private $provider;

Expand Down
7 changes: 2 additions & 5 deletions tests/Api/ApiProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

use Aws\Api\ApiProvider;
use Aws\Exception\UnresolvedApiException;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers Aws\Api\ApiProvider
*/
class ApiProviderTest extends TestCase
{
use PHPUnitCompatTrait;

/**
* @return ApiProvider;
*/
Expand Down Expand Up @@ -56,7 +53,7 @@ public function testCanGetServiceVersions()
public function testCanGetDefaultProvider()
{
$p = ApiProvider::defaultProvider();
$this->assertArrayHasKey('s3', $this->readAttribute($p, 'manifest'));
$this->assertArrayHasKey('s3', $this->getPropertyValue($p, 'manifest'));
}

public function testManifestProviderReturnsNullForMissingService()
Expand Down
6 changes: 3 additions & 3 deletions tests/Api/ErrorParser/XmlErrorParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
namespace Aws\Test\Api\ErrorParser;

use Aws\Api\ErrorParser\XmlErrorParser;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use Aws\Test\TestServiceTrait;
use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
use GuzzleHttp\Psr7;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers Aws\Api\ErrorParser\XmlErrorParser
*/
class XmlErrorParserTest extends TestCase
{
use PHPUnitCompatTrait;
use ArraySubsetAsserts;
use TestServiceTrait;

/**
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/ListShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

use Aws\Api\ShapeMap;
use Aws\Api\ListShape;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\ListShape
*/
class ListShapeTest extends TestCase
{
use PHPUnitCompatTrait;

public function testReturnsMember()
{
$s = new ListShape(
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/MapShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

use Aws\Api\ShapeMap;
use Aws\Api\MapShape;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\MapShape
*/
class MapShapeTest extends TestCase
{
use PHPUnitCompatTrait;

public function testReturnsValue()
{
$s = new MapShape(['value' => ['type' => 'string']], new ShapeMap([]));
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/OperationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

use Aws\Api\ShapeMap;
use Aws\Api\Operation;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\Operation
*/
class OperationTest extends TestCase
{
use PHPUnitCompatTrait;

public function testCreatesDefaultMethodAndUri()
{
$o = new Operation([], new ShapeMap([]));
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/Parser/Crc32ValidatingParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
use Aws\Api\Service;
use Aws\Command;
use Aws\Exception\AwsException;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers Aws\Api\Parser\Crc32ValidatingParser
*/
class Crc32ValidatingParserTest extends TestCase
{
use PHPUnitCompatTrait;

private function getWrapped()
{
$provider = ApiProvider::defaultProvider();
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/Parser/DecodingEventStreamIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@

use Aws\Api\Parser\DecodingEventStreamIterator;
use Aws\Api\Parser\Exception\ParserException;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Stream;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers Aws\Api\Parser\DecodingEventStreamIterator
*/
class DecodingEventStreamIteratorTest extends TestCase
{
use PHPUnitCompatTrait;

public function complianceTests()
{
$cases = [];
Expand Down
7 changes: 2 additions & 5 deletions tests/Api/Parser/EventParsingIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@
use Aws\Api\ShapeMap;
use Aws\Api\StructureShape;
use Aws\Exception\EventStreamDataException;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers Aws\Api\Parser\EventParsingIterator
*/
class EventParsingIteratorTest extends TestCase
{
use PHPUnitCompatTrait;

/** @var array */
private static $successEventNames = [
'end_event',
Expand All @@ -32,7 +29,7 @@ class EventParsingIteratorTest extends TestCase
/** @var StructureShape */
private $eventstreamShape;

public function _setUp()
public function set_up()
{
$shape = json_decode(
file_get_contents(
Expand Down
4 changes: 1 addition & 3 deletions tests/Api/Parser/JsonParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
namespace Aws\Test\Api\Parser;

use Aws\Api\Parser\Exception\ParserException;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* This class tests the custom functionality of the JsonParser;
Expand All @@ -13,7 +12,6 @@
*/
class JsonParserTest extends TestCase
{
use PHPUnitCompatTrait;
use ParserTestServiceTrait;

public function timeStampModelProvider()
Expand Down
6 changes: 1 addition & 5 deletions tests/Api/Parser/XmlParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
namespace Aws\Test\Api\Parser;

use Aws\Api\Parser\Exception\ParserException;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;

;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* This class tests the custom functionality of the XmlParser;
Expand All @@ -15,7 +12,6 @@
*/
class XmlParserTest extends TestCase
{
use PHPUnitCompatTrait;
use ParserTestServiceTrait;

public function timeStampModelProvider()
Expand Down
4 changes: 1 addition & 3 deletions tests/Api/Serializer/RestJsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
use Aws\Api\Service;
use Aws\Command;
use Aws\Api\Serializer\RestJsonSerializer;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use Aws\Test\UsesServiceTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers Aws\Api\Serializer\RestJsonSerializer
*/
class RestJsonSerializerTest extends TestCase
{
use PHPUnitCompatTrait;
use UsesServiceTrait;

private function getTestService()
Expand Down
4 changes: 1 addition & 3 deletions tests/Api/Serializer/RestXmlSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
namespace Aws\Test\Api\Serializer;

use Aws\Api\Serializer\RestXmlSerializer;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use Aws\Test\UsesServiceTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers Aws\Api\Serializer\RestXmlSerializer
*/
class RestXmlSerializerTest extends TestCase
{
use PHPUnitCompatTrait;
use UsesServiceTrait;

private function getRequest($commandName, $input)
Expand Down
6 changes: 2 additions & 4 deletions tests/Api/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
use Aws\Api\Parser\QueryParser;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use Aws\Test\TestServiceTrait;
use Aws\Test\UsesServiceTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\Service
*/
class ServiceTest extends TestCase
{
use PHPUnitCompatTrait;
use UsesServiceTrait;
use TestServiceTrait;

Expand Down Expand Up @@ -219,7 +217,7 @@ function () { return []; }
if ($parser instanceof QueryParser) {
$this->assertInstanceOf(
'Aws\Api\Parser\XmlParser',
$this->readAttribute($parser, 'parser')
$this->getPropertyValue($parser, 'parser')
);
}
}
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/ShapeMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
namespace Aws\Test\Api;

use Aws\Api\ShapeMap;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\ShapeMap
*/
class ShapeMapTest extends TestCase
{
use PHPUnitCompatTrait;

public function testReturnsShapeName()
{
$sm = new ShapeMap(['foo' => [], 'baz' => []]);
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/ShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@

use Aws\Api\Shape;
use Aws\Api\ShapeMap;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\Shape
* @covers \Aws\Api\AbstractModel
*/
class ShapeTest extends TestCase
{
use PHPUnitCompatTrait;

public function testImplementsArray()
{
$s = new Shape(['metadata' => ['foo' => 'bar']], new ShapeMap([]));
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/StructureShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

use Aws\Api\ShapeMap;
use Aws\Api\StructureShape;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\StructureShape
*/
class StructureShapeTest extends TestCase
{
use PHPUnitCompatTrait;

public function testReturnsWhenMembersAreEmpty()
{
$s = new StructureShape([], new ShapeMap([]));
Expand Down
5 changes: 1 addition & 4 deletions tests/Api/TimestampShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

use Aws\Api\TimestampShape;
use Aws\Api\ShapeMap;
use Aws\Test\Polyfill\PHPUnit\PHPUnitCompatTrait;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* @covers \Aws\Api\TimestampShape
*/
class TimestampShapeTest extends TestCase
{
use PHPUnitCompatTrait;

public function formatProvider()
{
$t = strtotime('january 5, 1999');
Expand Down
Loading

0 comments on commit 7237709

Please sign in to comment.