feat: add Laravel 11/12 and PHP 8.3+ support

- Widen illuminate/* deps to ^10.0|^11.0|^12.0, require PHP ^8.3
- Upgrade PHPUnit to ^10.5|^11.0, Mockery to ^1.6
- Rewrite phpunit.xml.dist for PHPUnit 10+ format (source/include
  replaces filter/whitelist, removed deprecated attributes)
- Replace $dates with $casts on Token model
- Implement DeferrableProvider interface instead of $defer property
  on ClientServiceProvider
- Use FQCN route definitions instead of string-based namespace()
- Fix migration getColumnType() check for Laravel 11+ native types
- Replace @test doc annotations with #[Test] attributes
- Fix dynamic property deprecation in ControllerTest
This commit is contained in:
Joel Male
2026-02-18 10:29:34 +10:00
parent 32f5c22846
commit 8ec2c3cc38
12 changed files with 86 additions and 157 deletions
+10 -27
View File
@@ -4,6 +4,7 @@
use Mockery;
use Mockery\Mock;
use PHPUnit\Framework\Attributes\Test;
use QuickBooksOnline\API\DataService\DataService;
use QuickBooksOnline\API\Exception\ServiceException;
@@ -53,17 +54,13 @@ private function makeClient($configs = null)
return new Client($this->configs, $this->token_mock);
}
/**
* @test
*/
#[Test]
public function it_can_be_constructed()
{
$this->assertInstanceOf(Client::class, $this->client);
}
/**
* @test
*/
#[Test]
public function it_returns_a_data_service_configured_to_request_oauth_token_when_token_is_empty()
{
$this->token_mock
@@ -86,9 +83,7 @@ public function it_returns_a_data_service_configured_to_request_oauth_token_when
);
}
/**
* @test
*/
#[Test]
public function it_caches_the_data_service_once_it_is_made()
{
$this->token_mock
@@ -107,9 +102,7 @@ public function it_caches_the_data_service_once_it_is_made()
$this->assertEquals(DataService::class, get_class($this->client->getDataService()));
}
/**
* @test
*/
#[Test]
public function it_returns_a_data_service_with_oauth_token_when_valid_access_token_exist()
{
$this->token_mock
@@ -144,9 +137,7 @@ public function it_returns_a_data_service_with_oauth_token_when_valid_access_tok
);
}
/**
* @test
*/
#[Test]
public function it_returns_a_data_service_with_refreshed_token_when_access_token_expired_but_refresh_token_valid()
{
$this->expectException(ServiceException::class);
@@ -189,9 +180,7 @@ public function it_returns_a_data_service_with_refreshed_token_when_access_token
);
}
/**
* @test
*/
#[Test]
public function it_returns_a_report_service_using_the_data_service()
{
$this->markTestSkipped(
@@ -199,9 +188,7 @@ public function it_returns_a_report_service_using_the_data_service()
);
}
/**
* @test
*/
#[Test]
public function it_has_logging_off_by_default()
{
$this->markTestSkipped('Have to figure out how to test this with the new code in 5.x');
@@ -227,9 +214,7 @@ public function it_has_logging_off_by_default()
);
}
/**
* @test
*/
#[Test]
public function it_allows_logging_turned_on_and_pointed_to_expected_file()
{
$this->markTestSkipped('Have to figure out how to test this with the new code in 5.x');
@@ -273,9 +258,7 @@ public function it_allows_logging_turned_on_and_pointed_to_expected_file()
);
}
/**
* @test
*/
#[Test]
public function it_returns_self_after_deleting_token()
{
$this->token_mock