first commit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KupShop\ProxyCacheBundle\Command;
|
||||
|
||||
use KupShop\ProxyCacheBundle\Util\CookiesFunctionalityTest;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Contracts\Service\Attribute\Required;
|
||||
|
||||
class CookiesFunctionalityTestCommand extends Command
|
||||
{
|
||||
#[Required]
|
||||
public CookiesFunctionalityTest $test;
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('kupshop:test:cookies')
|
||||
->setDescription('Test if cacheable responses return cookies');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$errors = $this->test->testInitialRequestCookiesAbsence();
|
||||
|
||||
$failed = false;
|
||||
foreach ($errors as $error) {
|
||||
$failed = true;
|
||||
$output->writeln('<error>COOKIE VRÁCENA:</error> '.$error);
|
||||
}
|
||||
|
||||
if ($failed) {
|
||||
$output->writeln('<comment>Více o tom jak funguje proxy_cache a jak má být nastavená: </comment>'.CookiesFunctionalityTest::WIKI_LINK);
|
||||
} else {
|
||||
$output->writeln('<info>Úspěch: na úvodní požadavky nebyly vráceny cookies</info>');
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user