31 lines
901 B
PHP
31 lines
901 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Tests\Unit\Command;
|
||
|
|
||
|
use App\Command\CronRunCommand;
|
||
|
use App\Repository\UserRepository;
|
||
|
use PHPUnit\Framework\TestCase;
|
||
|
use Symfony\Component\Console\Command\Command;
|
||
|
use Symfony\Component\Console\Input\InputInterface;
|
||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||
|
|
||
|
class CronRunCommandTest extends TestCase
|
||
|
{
|
||
|
public function testExecute()
|
||
|
{
|
||
|
// Arrange
|
||
|
$input = $this->createMock(originalClassName: InputInterface::class);
|
||
|
$output = $this->createMock(originalClassName: OutputInterface::class);
|
||
|
$userRepository = $this->createMock(originalClassName: UserRepository::class);
|
||
|
|
||
|
$command = new CronRunCommand(userRepository: $userRepository);
|
||
|
|
||
|
// Act
|
||
|
$result = $command->execute(input: $input, output: $output);
|
||
|
|
||
|
// Assert
|
||
|
$this->assertSame(expected: Command::SUCCESS, actual: $result);
|
||
|
}
|
||
|
|
||
|
}
|