mirror of
https://github.com/wearepixel/laravel-quickbooks.git
synced 2026-11-14 14:01:46 +00:00
feat: migrate test suite from PHPUnit to Pest
- Replace phpunit/phpunit with pestphp/pest ^3.0 - Drop scrutinizer/ocular (incompatible with Pest's symfony/console) - Add tests/Pest.php with MockeryPHPUnitIntegration trait binding - Extract namespace-level function stubs (config, route, dir) to tests/Overrides.php, loaded via autoload-dev files - Convert all 5 test classes to Pest closure-based syntax: setUp() → beforeEach(), assertions → expect(), skip() for skipped tests - Delete tests/TestCase.php (logic moved to Pest.php) - Stubs (TokenStub, User) unchanged
This commit is contained in:
@@ -1,36 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wearepixel\QuickBooks;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Wearepixel\QuickBooks\Stubs\User;
|
||||
use Wearepixel\QuickBooks\Token;
|
||||
|
||||
/**
|
||||
* Class HasQuickBooksTokenTest
|
||||
*/
|
||||
class HasQuickBooksTokenTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
protected $user;
|
||||
beforeEach(function () {
|
||||
$this->user = new User;
|
||||
});
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
it('can be constructed', function () {
|
||||
expect($this->user)->toBeInstanceOf(User::class);
|
||||
});
|
||||
|
||||
$this->user = new User;
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function it_can_be_constructed()
|
||||
{
|
||||
$this->assertInstanceOf(User::class, $this->user);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function it_has_a_has_one_relationship_to_token()
|
||||
{
|
||||
$this->assertInstanceOf(Token::class, $this->user->quickBooksToken()->getModel());
|
||||
}
|
||||
}
|
||||
it('has a hasOne relationship to token', function () {
|
||||
expect($this->user->quickBooksToken()->getModel())->toBeInstanceOf(Token::class);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user