Skip to content

Commit

Permalink
Add missing prophecy trait
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 16, 2024
1 parent 222f002 commit dce4c0b
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/Functional/BaseDatabaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ abstract class BaseDatabaseTestCase extends KernelTestCase
/**
* {@inheritdoc}
*/
public function setUp()
protected function setUp(): void
{
self::bootKernel();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ protected function setUp(): void
{
self::bootKernel();
if ('doctrine' !== self::$kernel->getContainer()->getParameter('kernel.storage')) {
return $this->markTestSkipped('This testcase will only be called for doctrine storage.');
$this->markTestSkipped('This testcase will only be called for doctrine storage.');
}

parent::setUp();
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Entity/TaskRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function setUp(): void
public function testFindBySystemKey()
{
if ('doctrine' !== self::$kernel->getContainer()->getParameter('kernel.storage')) {
return $this->markTestSkipped('This testcase will only be called for doctrine storage.');
$this->markTestSkipped('This testcase will only be called for doctrine storage.');
}

$task = $this->createTask();
Expand All @@ -37,7 +37,7 @@ public function testFindBySystemKey()
public function testFindBySystemKeyNotFound()
{
if ('doctrine' !== self::$kernel->getContainer()->getParameter('kernel.storage')) {
return $this->markTestSkipped('This testcase will only be called for doctrine storage.');
$this->markTestSkipped('This testcase will only be called for doctrine storage.');
}

$task = $this->createTask();
Expand All @@ -49,7 +49,7 @@ public function testFindBySystemKeyNotFound()
public function testFindSystemTasks()
{
if ('doctrine' !== self::$kernel->getContainer()->getParameter('kernel.storage')) {
return $this->markTestSkipped('This testcase will only be called for doctrine storage.');
$this->markTestSkipped('This testcase will only be called for doctrine storage.');
}

$task1 = $this->createTask();
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/Builder/TaskBuilderFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
namespace Unit\Builder;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Task\Scheduler\TaskSchedulerInterface;
use Task\TaskBundle\Builder\TaskBuilder;
use Task\TaskBundle\Builder\TaskBuilderFactory;
use Task\TaskInterface;

class TaskBuilderFactoryTest extends TestCase
{
use ProphecyTrait;

public function testCreate()
{
$task = $this->prophesize(TaskInterface::class);
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/Builder/TaskBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Task\TaskBundle\Unit\Builder;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Task\Scheduler\TaskSchedulerInterface;
use Task\TaskBundle\Builder\NotSupportedMethodException;
use Task\TaskBundle\Builder\TaskBuilder;
Expand All @@ -11,6 +12,8 @@

class TaskBuilderTest extends TestCase
{
use ProphecyTrait;

public function testSetSystemKey()
{
$task = $this->prophesize(Task::class);
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/Command/ScheduleSystemTasksCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Cron\CronExpression;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\OutputInterface;
use Task\Execution\TaskExecutionInterface;
Expand All @@ -19,6 +20,8 @@

class ScheduleSystemTasksCommandTest extends TestCase
{
use ProphecyTrait;

/**
* @var TaskSchedulerInterface
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/DependencyInjection/HandlerCompilerPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Task\TaskBundle\Unit\DependencyInjection;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -22,6 +23,8 @@
*/
class HandlerCompilerPassTest extends TestCase
{
use ProphecyTrait;

public function testProcess()
{
$container = $this->prophesize(ContainerBuilder::class);
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/EventListener/RunListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Task\TaskBundle\Tests\Unit\EventListener;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\EventDispatcher\Event as LegacyEvent;
use Symfony\Contracts\EventDispatcher\Event;
use Task\Runner\TaskRunnerInterface;
Expand All @@ -22,6 +23,8 @@
*/
class RunListenerTest extends TestCase
{
use ProphecyTrait;

public function testRun()
{
if (\class_exists(LegacyEvent::class)) {
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/EventListener/TaskExecutionListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Task\Event\TaskExecutionEvent;
use Task\TaskBundle\EventListener\DoctrineTaskExecutionListener;

Expand All @@ -21,6 +22,8 @@
*/
class TaskExecutionListenerTest extends TestCase
{
use ProphecyTrait;

public function testClearEntityManagerAfterTask()
{
$entityManager = $this->prophesize(EntityManagerInterface::class);
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/Executor/SeparateProcessExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Task\TaskBundle\Tests\Unit\Executor;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Process\Process;
use Task\Execution\TaskExecutionInterface;
use Task\Executor\FailedException;
Expand All @@ -25,6 +26,8 @@

class SeparateProcessExecutorTest extends TestCase
{
use ProphecyTrait;

/**
* @var TaskHandlerFactoryInterface
*/
Expand Down

0 comments on commit dce4c0b

Please sign in to comment.