diff --git a/tests/Assets/Auth/Passwords/UserMock.php b/tests/Assets/Auth/Passwords/UserMock.php index c106b527..f4c8fb8b 100644 --- a/tests/Assets/Auth/Passwords/UserMock.php +++ b/tests/Assets/Auth/Passwords/UserMock.php @@ -23,6 +23,5 @@ public function getEmailForPasswordReset() */ public function sendPasswordResetNotification($token) { - // TODO: Implement sendPasswordResetNotification() method. } } diff --git a/tests/Assets/Extensions/ExtensionMock.php b/tests/Assets/Extensions/ExtensionMock.php index e09e849f..0234a851 100644 --- a/tests/Assets/Extensions/ExtensionMock.php +++ b/tests/Assets/Extensions/ExtensionMock.php @@ -12,7 +12,7 @@ class ExtensionMock implements Extension public function addSubscribers(EventManager $manager, EntityManagerInterface $em): void { // Confirm it gets called - (new ExtensionManagerTest)->assertTrue(true); + (new ExtensionManagerTest())->assertTrue(true); } /** diff --git a/tests/Assets/FakeEventManager.php b/tests/Assets/FakeEventManager.php index b7fa21e8..d184a50c 100644 --- a/tests/Assets/FakeEventManager.php +++ b/tests/Assets/FakeEventManager.php @@ -2,6 +2,8 @@ namespace LaravelDoctrineTest\ORM\Assets; -class FakeEventManager extends \Doctrine\Common\EventManager +use Doctrine\Common\EventManager; + +class FakeEventManager extends EventManager { } diff --git a/tests/Assets/FilterStub.php b/tests/Assets/FilterStub.php index 82a5e8a0..8ed2cd69 100644 --- a/tests/Assets/FilterStub.php +++ b/tests/Assets/FilterStub.php @@ -2,9 +2,12 @@ namespace LaravelDoctrineTest\ORM\Assets; -class FilterStub extends \Doctrine\ORM\Query\Filter\SQLFilter +use Doctrine\ORM\Query\Filter\SQLFilter; +use Doctrine\ORM\Mapping\ClassMetadata; + +class FilterStub extends SQLFilter { - public function addFilterConstraint(\Doctrine\ORM\Mapping\ClassMetadata $targetEntity, string $targetTableAlias): string + public function addFilterConstraint(ClassMetadata $targetEntity, string $targetTableAlias): string { return ''; } diff --git a/tests/Assets/Middleware/BindableEntityWithInterface.php b/tests/Assets/Middleware/BindableEntityWithInterface.php index 97f4fab5..71304f8e 100644 --- a/tests/Assets/Middleware/BindableEntityWithInterface.php +++ b/tests/Assets/Middleware/BindableEntityWithInterface.php @@ -2,7 +2,9 @@ namespace LaravelDoctrineTest\ORM\Assets\Middleware; -class BindableEntityWithInterface implements \LaravelDoctrine\ORM\Contracts\UrlRoutable +use LaravelDoctrine\ORM\Contracts\UrlRoutable; + +class BindableEntityWithInterface implements UrlRoutable { public $id; diff --git a/tests/Assets/Notifications/NotificationDatabaseStub.php b/tests/Assets/Notifications/NotificationDatabaseStub.php index 958a9c68..579d3337 100644 --- a/tests/Assets/Notifications/NotificationDatabaseStub.php +++ b/tests/Assets/Notifications/NotificationDatabaseStub.php @@ -2,10 +2,13 @@ namespace LaravelDoctrineTest\ORM\Assets\Notifications; -class NotificationDatabaseStub extends \Illuminate\Notifications\Notification +use Illuminate\Notifications\Notification as IlluminateNotification; +use LaravelDoctrine\ORM\Notifications\Notification; + +class NotificationDatabaseStub extends IlluminateNotification { public function toDatabase() { - return (new \LaravelDoctrine\ORM\Notifications\Notification()); + return new Notification(); } } diff --git a/tests/Assets/Notifications/NotificationInvalidStub.php b/tests/Assets/Notifications/NotificationInvalidStub.php index 73e35380..9efe61fa 100644 --- a/tests/Assets/Notifications/NotificationInvalidStub.php +++ b/tests/Assets/Notifications/NotificationInvalidStub.php @@ -2,6 +2,8 @@ namespace LaravelDoctrineTest\ORM\Assets\Notifications; -class NotificationInvalidStub extends \Illuminate\Notifications\Notification +use Illuminate\Notifications\Notification as IlluminateNotification; + +class NotificationInvalidStub extends IlluminateNotification { } diff --git a/tests/Assets/Notifications/NotificationStub.php b/tests/Assets/Notifications/NotificationStub.php index 76d198f3..df5529e6 100644 --- a/tests/Assets/Notifications/NotificationStub.php +++ b/tests/Assets/Notifications/NotificationStub.php @@ -2,10 +2,13 @@ namespace LaravelDoctrineTest\ORM\Assets\Notifications; -class NotificationStub extends \Illuminate\Notifications\Notification +use Illuminate\Notifications\Notification as IlluminateNotification; +use LaravelDoctrine\ORM\Notifications\Notification; + +class NotificationStub extends IlluminateNotification { public function toEntity() { - return (new \LaravelDoctrine\ORM\Notifications\Notification()); + return new Notification(); } } diff --git a/tests/Assets/Testing/AncestorHydrateableClass.php b/tests/Assets/Testing/AncestorHydrateableClass.php index dc7c2b0b..63291c1a 100644 --- a/tests/Assets/Testing/AncestorHydrateableClass.php +++ b/tests/Assets/Testing/AncestorHydrateableClass.php @@ -4,9 +4,9 @@ class AncestorHydrateableClass { - private $name; + private string $name = ''; - public function getName() + public function getName(): string { return $this->name; } diff --git a/tests/Assets/Testing/ChildHydrateableClass.php b/tests/Assets/Testing/ChildHydrateableClass.php index 0366d621..1631fab2 100644 --- a/tests/Assets/Testing/ChildHydrateableClass.php +++ b/tests/Assets/Testing/ChildHydrateableClass.php @@ -4,9 +4,9 @@ class ChildHydrateableClass extends AncestorHydrateableClass { - private $description; + private string $description = ''; - public function getDescription() + public function getDescription(): string { return $this->description; } diff --git a/tests/TestCase.php b/tests/TestCase.php index 1e94d5af..4a397b0e 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -12,10 +12,19 @@ class TestCase extends PHPUnitTestCase protected function setUp(): void { $this->application = new Application(); + + parent::setUp(); } protected function tearDown(): void { unset($this->application); + + parent::tearDown(); + } + + public function getApplication(): Application + { + return $this->application; } }