Skip to content
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
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpcov": "^11.0",
"phpunit/phpunit": "^12.4",
"roave/security-advisories": "dev-master",
"phpunit/phpunit": "^12.5",
"shlinkio/php-coding-standard": "~2.5.0",
"symfony/var-dumper": "^7.3"
"symfony/var-dumper": "^7.4 || ^8.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
bootstrap="./vendor/autoload.php"
colors="true"
cacheDirectory="build/.phpunit.cache"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnPhpunitNotices="true"
displayDetailsOnTestsThatTriggerNotices="true"
>
<testsuites>
<testsuite name="SDK Unit tests">
Expand Down
6 changes: 3 additions & 3 deletions test/Builder/ShlinkClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class ShlinkClientBuilderTest extends TestCase
public function setUp(): void
{
$this->builder = new ShlinkClientBuilder(
$this->createMock(ClientInterface::class),
$this->createMock(RequestFactoryInterface::class),
$this->createMock(StreamFactoryInterface::class),
$this->createStub(ClientInterface::class),
$this->createStub(RequestFactoryInterface::class),
$this->createStub(StreamFactoryInterface::class),
);
$this->config = ShlinkConfig::fromBaseUrlAndApiKey('foo', 'bar');
}
Expand Down
10 changes: 5 additions & 5 deletions test/Builder/SingletonShlinkClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ public function buildClientReturnsAlwaysNewInstances(string $method): void
$this->wrapped->expects($this->exactly(2))->method($method)->with(
$this->isInstanceOf(ShlinkConfigInterface::class),
)->willReturn(new ShlinkClient(
$this->createMock(ShortUrlsClientInterface::class),
$this->createMock(VisitsClientInterface::class),
$this->createMock(TagsClientInterface::class),
$this->createMock(DomainsClientInterface::class),
$this->createMock(RedirectRulesClientInterface::class),
$this->createStub(ShortUrlsClientInterface::class),
$this->createStub(VisitsClientInterface::class),
$this->createStub(TagsClientInterface::class),
$this->createStub(DomainsClientInterface::class),
$this->createStub(RedirectRulesClientInterface::class),
));

$configOne = ShlinkConfig::fromBaseUrlAndApiKey('foo', 'bar');
Expand Down
4 changes: 2 additions & 2 deletions test/Http/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public function setUp(): void
{
$this->client = $this->createMock(ClientInterface::class);

$requestFactory = $this->createMock(RequestFactoryInterface::class);
$requestFactory = $this->createStub(RequestFactoryInterface::class);
$requestFactory->method('createRequest')->willReturnCallback(
fn (string $method, string|UriInterface $uri) => new Request($method, $uri),
);

$streamFactory = $this->createMock(StreamFactoryInterface::class);
$streamFactory = $this->createStub(StreamFactoryInterface::class);
$streamFactory->method('createStream')->willReturnCallback(fn (string $content) => Utils::streamFor($content));

$this->httpClient = new HttpClient(
Expand Down
2 changes: 2 additions & 0 deletions test/ShlinkClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use DateTimeImmutable;
use DateTimeInterface;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Attributes\TestWith;
use PHPUnit\Framework\MockObject\MockObject;
Expand Down Expand Up @@ -36,6 +37,7 @@
use Shlinkio\Shlink\SDK\Visits\Model\VisitsOverview;
use Shlinkio\Shlink\SDK\Visits\VisitsClientInterface;

#[AllowMockObjectsWithoutExpectations]
class ShlinkClientTest extends TestCase
{
private ShlinkClient $shlinkClient;
Expand Down
Loading