assets
bin
config
migrations
public
src
templates
tests
Unit
Command
CronRunCommandTest.php
Controller
Entity
bootstrap.php
tools
translations
.env
.env.test
.eslintrc
.gitignore
.php-cs-fixer.cache
.php-cs-fixer.php
LICENSE
README.md
TODO
bootstrap.js
composer.json
composer.lock
controllers.json
docker-compose.override.yml
docker-compose.yml
package.json
phpunit.xml.dist
rector.php
symfony.lock
webpack.config.js
yarn.lock
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);
|
|
}
|
|
|
|
}
|