added PHPUinit

This commit is contained in:
2022-12-28 12:39:02 +01:00
parent 97a4f63946
commit cb3cacb2dd
84 changed files with 18549 additions and 824 deletions

View 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);
}
}