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

Laravel 11 compatibility #282

Merged
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
],
"require": {
"aws/aws-sdk-php": "^3.0.0",
"illuminate/support": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0|^10.0",
"illuminate/database": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0|^10.0"
"illuminate/support": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0| ^10.0 || ^11.0",
"illuminate/database": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0| ^10.0 || v11.0"
},
"license": "MIT",
"authors": [
Expand Down
20 changes: 10 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<source>
<include>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
</include>
</source>
</phpunit>
5 changes: 3 additions & 2 deletions tests/DynamoDb/DynamoDbManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use BaoPham\DynamoDb\DynamoDbClientInterface;
use BaoPham\DynamoDb\Tests\DynamoDbTestCase;
use BaoPham\DynamoDb\DynamoDb\DynamoDbManager;
use BaoPham\DynamoDb\Tests\Mocks\DynamoDbClientMock;

class DynamoDbManagerTest extends DynamoDbTestCase
{
Expand All @@ -25,9 +26,9 @@ public function setUp(): void
parent::setUp();

$this->mockedClient = $this
->getMockBuilder(DynamoDbClient::class)
->getMockBuilder(DynamoDbClientMock::class)
->disableOriginalConstructor()
->setMethods(['putItem', 'updateItem', 'deleteItem', 'scan', 'query', 'batchWriteItem'])
->onlyMethods(['putItem', 'updateItem', 'deleteItem', 'scan', 'query', 'batchWriteItem'])
->getMock();

$service = $this->getMockBuilder(DynamoDbClientInterface::class)->getMock();
Expand Down
39 changes: 39 additions & 0 deletions tests/Mocks/DynamoDbClientMock.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace BaoPham\DynamoDb\Tests\Mocks;

use Aws\DynamoDb\DynamoDbClient;
use Aws\Result;

class DynamoDbClientMock extends DynamoDbClient
{
public function putItem(array $args = []): Result
{
return parent::putItem($args);
}

public function updateItem(array $args = []): Result
{
return parent::updateItem($args);
}

public function deleteItem(array $args = []): Result
{
return parent::deleteItem($args);
}

public function scan(array $args = []): Result
{
return parent::scan($args);
}

public function query(array $args = []): Result
{
return parent::query($args);
}

public function batchWriteItem(array $args = []): Result
{
return parent::batchWriteItem($args);
}
}