Skip to content

Commit

Permalink
TASK: Add ProphecyTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed Feb 23, 2023
1 parent 7032d2c commit 18fbfe0
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 7 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/Unit/Application/BaseApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use TYPO3\Surf\Application\BaseApplication;
use TYPO3\Surf\Domain\Model\Deployment;
Expand All @@ -23,6 +24,7 @@

class BaseApplicationTest extends TestCase
{
use ProphecyTrait;
private BaseApplication $subject;

protected function setUp(): void
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Application/LaravelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use TYPO3\Surf\Application\Laravel;
use TYPO3\Surf\Domain\Model\Deployment;
use TYPO3\Surf\Domain\Model\Workflow;
use TYPO3\Surf\Tests\Unit\FluidPromise;

class LaravelTest extends TestCase
{
use ProphecyTrait;
protected Laravel $subject;

protected function setUp(): void
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Application/Neos/FlowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace TYPO3\Surf\Tests\Unit\Application\Neos;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use TYPO3\Surf\Application\Neos\Flow;
use TYPO3\Surf\Domain\Model\Deployment;
Expand All @@ -21,6 +22,7 @@

class FlowTest extends TestCase
{
use ProphecyTrait;
protected Flow $subject;

protected function setUp(): void
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Application/TYPO3/CMSTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use TYPO3\Surf\Application\TYPO3\CMS;
use TYPO3\Surf\Domain\Model\Deployment;
use TYPO3\Surf\Domain\Model\Workflow;
use TYPO3\Surf\Tests\Unit\FluidPromise;

class CMSTest extends TestCase
{
use ProphecyTrait;
protected CMS $subject;

protected function setUp(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/AssertCommandExecuted.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(string $expectedCommand)
protected function matches($other): bool
{
if (!is_array($other)) {
throw new \InvalidArgumentException('Expected an array of executed commands as value, ' . gettype($other) . ' given');
throw new InvalidArgumentException('Expected an array of executed commands as value, ' . gettype($other) . ' given');
}

foreach ($other as $command) {
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Cli/Symfony/Logger/ConsoleHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\Surf\Cli\Symfony\Logger\ConsoleFormatter;
use TYPO3\Surf\Cli\Symfony\Logger\ConsoleHandler;

class ConsoleHandlerTest extends TestCase
{
use ProphecyTrait;
/**
* @test
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Cli/Symfony/Logger/LoggerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use TYPO3\Surf\Cli\Symfony\Logger\ConsoleHandler;
use TYPO3\Surf\Cli\Symfony\Logger\LoggerFactory;

class LoggerFactoryTest extends TestCase
{
use ProphecyTrait;
/**
* @test
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Command/DeployCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Component\Console\Tester\CommandTester;
use TYPO3\Surf\Command\DeployCommand;
Expand All @@ -22,6 +23,7 @@

final class DeployCommandTest extends TestCase
{
use ProphecyTrait;
/**
* @var DeployCommand
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Command/RollbackCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace TYPO3\Surf\Tests\Unit\Command;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Console\Tester\CommandTester;
use TYPO3\Surf\Command\RollbackCommand;
use TYPO3\Surf\Domain\Enum\DeploymentStatus;
Expand All @@ -20,6 +21,7 @@

class RollbackCommandTest extends TestCase
{
use ProphecyTrait;
/**
* @test
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Command/ShowCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
namespace TYPO3\Surf\Tests\Unit\Command;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Console\Tester\CommandTester;
use TYPO3\Surf\Command\ShowCommand;
use TYPO3\Surf\Integration\FactoryInterface;

class ShowCommandTest extends TestCase
{
use ProphecyTrait;
/**
* @test
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Command/SimulateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace TYPO3\Surf\Tests\Unit\Command;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Console\Tester\CommandTester;
use TYPO3\Surf\Command\SimulateCommand;
use TYPO3\Surf\Domain\Enum\DeploymentStatus;
Expand All @@ -20,6 +21,7 @@

class SimulateCommandTest extends TestCase
{
use ProphecyTrait;
/**
* @test
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Domain/Model/DeploymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace TYPO3\Surf\Tests\Unit\Domain\Model;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use TYPO3\Surf\Domain\Model\Application;
use TYPO3\Surf\Domain\Model\Deployment;
use TYPO3\Surf\Domain\Model\Node;
Expand All @@ -25,6 +26,7 @@
*/
class DeploymentTest extends TestCase
{
use ProphecyTrait;
use KernelAwareTrait;

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Domain/Service/TaskManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Log\LoggerInterface;
use TYPO3\Surf\Domain\Model\Application;
Expand All @@ -24,6 +25,7 @@

class TaskManagerTest extends TestCase
{
use ProphecyTrait;
/**
* @var ObjectProphecy|Task
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Integration/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use RuntimeException;
use TYPO3\Surf\Domain\Filesystem\FilesystemInterface;
Expand All @@ -25,6 +26,7 @@

class FactoryTest extends TestCase
{
use ProphecyTrait;
use KernelAwareTrait;

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Task/BaseTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Log\LoggerInterface;
use TYPO3\Surf\Domain\Model\Application;
Expand All @@ -29,6 +30,7 @@
*/
abstract class BaseTaskTest extends TestCase
{
use ProphecyTrait;
use KernelAwareTrait;

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Task/CleanupReleasesTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use PHPUnit\Framework\MockObject\MockObject;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use TYPO3\Surf\Domain\Clock\ClockInterface;
use TYPO3\Surf\Domain\Model\Application;
Expand All @@ -25,6 +26,7 @@

class CleanupReleasesTaskTest extends BaseTaskTest
{
use ProphecyTrait;
use KernelAwareTrait;

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Task/CreateArchiveTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace TYPO3\Surf\Tests\Unit\Task;

use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use TYPO3\Surf\Domain\Filesystem\FilesystemInterface;
use TYPO3\Surf\Domain\Generator\IdGeneratorInterface;
Expand All @@ -20,6 +21,7 @@
class CreateArchiveTaskTest extends BaseTaskTest
{
private const SOURCE_DIRECTORY = '/var/www/html/source/';
use ProphecyTrait;

/**
* @var FilesystemInterface|ObjectProphecy
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Task/TYPO3/CMS/SetUpExtensionsTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace TYPO3\Surf\Tests\Unit\Task\TYPO3\CMS;

use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use TYPO3\Surf\Application\TYPO3\CMS;
use TYPO3\Surf\Domain\Version\VersionCheckerInterface;
Expand All @@ -20,6 +21,7 @@

class SetUpExtensionsTaskTest extends BaseTaskTest
{
use ProphecyTrait;
/**
* @var ObjectProphecy|VersionCheckerInterface
*/
Expand Down

0 comments on commit 18fbfe0

Please sign in to comment.