added PHPUinit
This commit is contained in:
30
tests/Unit/Command/CronRunCommandTest.php
Normal file
30
tests/Unit/Command/CronRunCommandTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user