Skip to content

Commit

Permalink
Fix (some) property types in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Dec 29, 2023
1 parent 7ee8e60 commit 0201856
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 41 deletions.
6 changes: 2 additions & 4 deletions Test/Integration/CleanRunningJobsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use EthanYehuda\CronjobManager\Model\ErrorNotificationInterface;
use EthanYehuda\CronjobManager\Test\Util\FakeClock;
use Magento\Cron\Model\Schedule;
use Magento\Framework\ObjectManager\ObjectManager;
use Magento\Framework\ObjectManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use PHPUnit\Framework\TestCase;
use Magento\Framework\Event;
Expand All @@ -23,9 +23,7 @@ class CleanRunningJobsTest extends TestCase
protected const REMOTE_HOSTNAME = 'hostname.example.net';
protected const DEAD_PID = 99999999;

/**
* @var ObjectManager
*/
/** @var ObjectManagerInterface */
private $objectManager;

/**
Expand Down
10 changes: 3 additions & 7 deletions Test/Integration/ErrorNotificationEmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
use Magento\Cron\Model\Schedule;
use Magento\Framework\Mail\Message;
use Magento\Framework\Mail\Template\TransportBuilder;
use Magento\Framework\ObjectManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\Mail\Template\TransportBuilderMock;
use Magento\TestFramework\ObjectManager;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -19,19 +19,15 @@
*/
class ErrorNotificationEmailTest extends TestCase
{
/**
* @var ObjectManager
*/
/** @var ObjectManagerInterface */
private $objectManager;

/**
* @var ErrorNotificationEmail
*/
private $errorNotificationEmail;

/**
* @var \Magento\TestFramework\Mail\Template\TransportBuilderMock
*/
/** @var TransportBuilderMock */
private $transportBuilder;

protected function setUp(): void
Expand Down
20 changes: 7 additions & 13 deletions Test/Integration/ErrorNotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
use EthanYehuda\CronjobManager\Model\ClockInterface;
use EthanYehuda\CronjobManager\Model\ErrorNotificationInterface;
use EthanYehuda\CronjobManager\Model\ErrorNotificationEmail;
use EthanYehuda\CronjobManager\Plugin\Cron\Model\ScheduleResourcePlugin;
use EthanYehuda\CronjobManager\Test\Util\FakeClock;
use EthanYehuda\CronjobManager\Test\Util\FakeJobConfig;
use Magento\Cron\Model\ConfigInterface;
use Magento\Cron\Model\Schedule;
use Magento\Cron\Observer\ProcessCronQueueObserver;
use Magento\Framework\Api\SearchCriteria;
use Magento\Framework\Event;
use Magento\Framework\App\CacheInterface;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\TestFramework\ObjectManager;
use Magento\TestFramework\Helper\Bootstrap;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -31,9 +31,7 @@ class ErrorNotificationTest extends TestCase
{
protected const NOW = '2019-02-09 18:33:00';

/**
* @var ObjectManager
*/
/** @var ObjectManagerInterface */
private $objectManager;

/**
Expand All @@ -51,14 +49,10 @@ class ErrorNotificationTest extends TestCase
*/
private $clock;

/**
* @var \Magento\Framework\App\CacheInterface
*/
/** @var CacheInterface */
private $cache;

/**
* @var ErrorNotificationInterface|\PHPUnit_Framework_MockObject_MockObject
*/
/** @var (ErrorNotificationInterface&MockObject)|MockObject */
private $errorNotification;

/**
Expand All @@ -82,7 +76,7 @@ protected function setUp(): void
$this->setUpMocks();
$this->scheduleManagement = $this->objectManager->get(ScheduleManagementInterface::class);
$this->scheduleRepository = $this->objectManager->get(ScheduleRepositoryInterface::class);
$this->cache = $this->objectManager->get(\Magento\Framework\App\CacheInterface::class);
$this->cache = $this->objectManager->get(CacheInterface::class);
$this->processCronQueueObserver = $this->objectManager->get(ProcessCronQueueObserver::class);
$this->cleanSchedule();
}
Expand Down
6 changes: 2 additions & 4 deletions Test/Integration/HostnameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Magento\Cron\Model\ResourceModel\Schedule as ScheduleResource;
use Magento\Cron\Model\Schedule;
use Magento\Framework\ObjectManager\ObjectManager;
use Magento\Framework\ObjectManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use PHPUnit\Framework\TestCase;

Expand All @@ -16,9 +16,7 @@
*/
class HostnameTest extends TestCase
{
/**
* @var ObjectManager
*/
/** @var ObjectManagerInterface */
protected $objectManager;

/**
Expand Down
6 changes: 2 additions & 4 deletions Test/Integration/Model/ScheduleManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use EthanYehuda\CronjobManager\Api\ScheduleManagementInterface;
use Magento\Cron\Model\Schedule;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\ObjectManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\ObjectManager;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -21,9 +21,7 @@ class ScheduleManagementTest extends TestCase
*/
private $scheduleManagement;

/**
* @var ObjectManager
*/
/** @var ObjectManagerInterface */
private $objectManager;

protected const NOW = '2019-02-09 18:33:00';
Expand Down
6 changes: 2 additions & 4 deletions Test/Integration/ProcessIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace EthanYehuda\CronjobManager\Test\Integration;

use Magento\Cron\Model\Schedule;
use Magento\Framework\ObjectManager\ObjectManager;
use Magento\Framework\ObjectManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use PHPUnit\Framework\TestCase;

Expand All @@ -15,9 +15,7 @@
*/
class ProcessIdTest extends TestCase
{
/**
* @var ObjectManager
*/
/** @var ObjectManagerInterface */
private $objectManager;

protected function setUp(): void
Expand Down
6 changes: 2 additions & 4 deletions Test/Integration/ProcessKillRequestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use EthanYehuda\CronjobManager\Test\Util\FakeClock;
use Magento\Cron\Model\Schedule;
use Magento\Framework\Event;
use Magento\Framework\ObjectManager\ObjectManager;
use Magento\Framework\ObjectManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use PHPUnit\Framework\TestCase;

Expand All @@ -30,9 +30,7 @@ class ProcessKillRequestsTest extends TestCase
*/
private $childPid = 0;

/**
* @var ObjectManager
*/
/** @var ObjectManagerInterface */
private $objectManager;

/**
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Console/Command/RunjobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class RunjobTest extends TestCase
{
/** @var Runner|(Runner&MockObject)|MockObject */
/** @var (Runner&MockObject)|MockObject */
protected $runner;

protected function setUp(): void
Expand Down

0 comments on commit 0201856

Please sign in to comment.