Skip to content

Commit

Permalink
Minor fixes for specs and unit tests of cache control subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Mar 7, 2022
1 parent 08d0f5a commit 94366fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function it_returns_proper_cache_headers_for_admin_endpoints(): void
/**
* @test
*/
public function it_returns_normal_headers_otherwise(): void
public function it_returns_standard_headers_otherwise(): void
{
$client = static::createClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
namespace spec\Sylius\Bundle\AdminBundle\EventListener;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\AdminBundle\EmailManager\ShipmentEmailManagerInterface;
use Sylius\Bundle\AdminBundle\SectionResolver\AdminSection;
use Sylius\Bundle\CoreBundle\SectionResolver\SectionInterface;
use Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface;
use Sylius\Component\Core\Model\ShipmentInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
Expand All @@ -35,7 +32,7 @@ function let(SectionProviderInterface $sectionProvider): void
$this->beConstructedWith($sectionProvider);
}

function it_subscribes_to_kernel_response_event()
function it_subscribes_to_kernel_response_event(): void
{
$this::getSubscribedEvents()->shouldReturn([KernelEvents::RESPONSE => 'setCacheControlDirectives']);
}
Expand Down Expand Up @@ -67,7 +64,7 @@ function it_adds_cache_control_directives_to_admin_requests(
$this->setCacheControlDirectives($event);
}

function it_does_nothing_if_section_is_different_then_admin(
function it_does_nothing_if_section_is_different_than_admin(
SectionProviderInterface $sectionProvider,
HttpKernelInterface $kernel,
Request $request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

declare(strict_types=1);

namespace Sylius\Bundle\AdminBundle\Tests\EventListener;
namespace Sylius\Bundle\ShopBundle\Tests\EventListener;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

final class AdminSectionCacheControlSubscriberTest extends WebTestCase
final class ShopCustomerAccountSubSectionCacheControlSubscriberTest extends WebTestCase
{
/**
* @test
Expand All @@ -32,7 +32,7 @@ public function it_returns_proper_cache_headers_for_customer_account_endpoints()
/**
* @test
*/
public function it_returns_normal_headers_otherwise(): void
public function it_returns_standard_headers_otherwise(): void
{
$client = static::createClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function it_adds_cache_control_directives_to_customer_account_requests(
$this->setCacheControlDirectives($event);
}

function it_does_nothing_if_section_is_different_then_customer_account(
function it_does_nothing_if_section_is_different_than_customer_account(
SectionProviderInterface $sectionProvider,
HttpKernelInterface $kernel,
Request $request,
Expand Down

0 comments on commit 94366fd

Please sign in to comment.