Skip to content
Open
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
16 changes: 11 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@
}
],
"require": {
"php": "^7.3|^8.0",
"webmozart/assert": "^1.2",
"guzzlehttp/guzzle": "^6.3|^7.0.1",
"rize/uri-template": "^0.3.5|^0.4.0"
"php": "^8.2",
"webmozart/assert": "^2.0",
"guzzlehttp/guzzle": "^7.0",
"rize/uri-template": "^0.4.0"
},
"require-dev": {
"phpunit/phpunit": "^8.4",
"phpunit/phpunit": "^10.0",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.4",
"mockery/mockery": "^1.1",
"ramsey/uuid": "^4.1"
},
"replace": {
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*"
},
"autoload": {
"psr-4": { "HelpScout\\Api\\": "src/" }
},
Expand Down
45 changes: 22 additions & 23 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-html" target="build/reports/phpunit"/>
</logging>

<php>
<ini name="error_reporting" value="-1" />
<ini name="date.timezone" value="UTC" />
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/reports/phpunit"/>
</report>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<logging/>
<php>
<ini name="error_reporting" value="-1"/>
<ini name="date.timezone" value="UTC"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions src/Assert/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class Assert extends BaseAssert
/**
* {@inheritdoc}
*
* @return InvalidArgumentException
* @throws InvalidArgumentException
*/
protected static function reportInvalidArgument($message)
protected static function reportInvalidArgument(string $message): never
{
throw new InvalidArgumentException($message);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Conversations/ConversationFiltersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function testWithValidSortField($sortField)
], $filters->getParams());
}

public function sortFieldProvider(): array
public static function sortFieldProvider(): array
{
return [
['createdAt'],
Expand Down Expand Up @@ -133,7 +133,7 @@ public function testWithValidSortOrder($sortOrder, $sortOrderParam)
], $filters->getParams());
}

public function sortOrderProvider(): array
public static function sortOrderProvider(): array
{
return [
['asc', 'asc'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Conversations/ConversationRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testAddsLinks($rel)
$this->assertTrue($request->hasLink($rel));
}

public function linkProvider()
public static function linkProvider()
{
return [
[ConversationLinks::MAILBOX],
Expand Down
4 changes: 2 additions & 2 deletions tests/Customers/CustomerFiltersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testWithValidSortField($sortField)
], $filters->getParams());
}

public function sortFieldProvider(): array
public static function sortFieldProvider(): array
{
return [
['score'],
Expand Down Expand Up @@ -90,7 +90,7 @@ public function testWithValidSortOrder($sortOrder, $sortOrderParam)
], $filters->getParams());
}

public function sortOrderProvider(): array
public static function sortOrderProvider(): array
{
return [
['asc', 'asc'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Customers/CustomerRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testAddsLinks($rel)
$this->assertTrue($request->hasLink($rel));
}

public function linkProvider()
public static function linkProvider()
{
return [
[CustomerLinks::ADDRESS],
Expand Down
2 changes: 1 addition & 1 deletion tests/Http/AuthenticatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function testIdentifiesWhenToAutoRefreshToken(array $args)
);
}

public function autoRefreshAccessTokenProvider(): \Generator
public static function autoRefreshAccessTokenProvider(): \Generator
{
$typesThatCanRefreshTokens = [
ClientCredentials::TYPE,
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/RestClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function testDeciderDoesNotRetry(...$params)
$this->assertFalse($shouldRetry);
}

public function noRetryParamProvider(): \Generator
public static function noRetryParamProvider(): \Generator
{
$request = new Request(
'POST',
Expand Down Expand Up @@ -272,7 +272,7 @@ public function testDeciderDoesRetry(...$params)
$this->assertTrue($shouldRetry);
}

public function retryParamProvider(): \Generator
public static function retryParamProvider(): \Generator
{
$request = new Request(
'POST',
Expand Down
2 changes: 1 addition & 1 deletion tests/Mailboxes/MailboxRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testAddsLinks($rel)
$this->assertTrue($request->hasLink($rel));
}

public function linkProvider()
public static function linkProvider()
{
return [
[MailboxLinks::FIELDS],
Expand Down
3 changes: 0 additions & 3 deletions tests/ReflectionTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function invokeMethod($object, string $method, array $parameters = [])

$reflection = new \ReflectionClass($class);
$reflectedMethod = $reflection->getMethod($method);
$reflectedMethod->setAccessible(true);

return $reflectedMethod->invokeArgs($object, $parameters);
}
Expand All @@ -35,7 +34,6 @@ public function getAttribute($object, string $attributeName)
{
$reflection = new \ReflectionClass($object);
$property = $reflection->getProperty($attributeName);
$property->setAccessible(true);

return $property->getValue($object);
}
Expand All @@ -51,7 +49,6 @@ public function setAttribute($object, string $attributeName, $value): void
$class = $this->getClassName($object);

$reflection = new \ReflectionProperty($class, $attributeName);
$reflection->setAccessible(true);
$reflection->setValue($object, $value);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Reports/ReportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class ReportTest extends TestCase
{
public function reportTypeProvider(): array
public static function reportTypeProvider(): array
{
return [
[Reports\Company\Overall::class],
Expand Down