Skip to content

Commit

Permalink
Remove deprecated spaceless filter (#1794)
Browse files Browse the repository at this point in the history
* Fix cs

* Fix tests

* Bump

* Remove deprecated spaceless

* Debug

* Avoid format issues
  • Loading branch information
VincentLanglet authored Feb 15, 2025
1 parent ec38020 commit 1a9bdc8
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cocur/slugify": "^4.0",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/persistence": "^3.0.2",
"sonata-project/admin-bundle": "^4.34",
"sonata-project/admin-bundle": "^4.35.3",
"sonata-project/block-bundle": "^4.18 || ^5.0",
"sonata-project/doctrine-extensions": "^1.18 || ^2.1",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
Expand Down
2 changes: 0 additions & 2 deletions src/Resources/views/PageAdmin/field_hybrid.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ file that was distributed with this source code.
{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}

{% block field %}
{% apply spaceless %}
{% if object.isHybrid %}
<i class="fa fa-gears"></i>
{% else %}
<i class="fa fa-code"></i>
{% endif %}
{% endapply %}
{% endblock %}
4 changes: 2 additions & 2 deletions tests/Admin/Extension/CreateSnapshotAdminExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testPostRemoveOnBlock(): void
{
$page = $this->createMock(PageInterface::class);
$block = $this->createMock(PageBlockInterface::class);
$admin = $this->createStub(AdminInterface::class);
$admin = static::createStub(AdminInterface::class);
$createSnapshotByPage = $this->createMock(CreateSnapshotByPageInterface::class);

$block->expects(static::once())->method('getPage')->willReturn($page);
Expand All @@ -91,7 +91,7 @@ public function testPostRemoveOnBlock(): void
public function testPostRemoveOnPage(): void
{
$page = $this->createMock(PageInterface::class);
$admin = $this->createStub(AdminInterface::class);
$admin = static::createStub(AdminInterface::class);
$createSnapshotByPage = $this->createMock(CreateSnapshotByPageInterface::class);

$createSnapshotByPage->expects(static::never())->method('createByPage');
Expand Down
8 changes: 4 additions & 4 deletions tests/Admin/PageAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ public function testTabMenuHasLinksWithSubSite(): void
{
$request = new Request(['id' => 42]);
$admin = new PageAdmin(
$this->createStub(PageManagerInterface::class),
$this->createStub(SiteManagerInterface::class),
static::createStub(PageManagerInterface::class),
static::createStub(SiteManagerInterface::class),
);
$admin->setModelManager($this->createStub(ModelManagerInterface::class));
$admin->setModelManager(static::createStub(ModelManagerInterface::class));
$admin->setModelClass(Page::class);
$admin->setBaseControllerName(PageController::class);
$admin->setCode('admin.page');
$admin->setMenuFactory(new MenuFactory());
$admin->setRequest($request);

$site = $this->createStub(Site::class);
$site = static::createStub(Site::class);
$site->method('getRelativePath')->willReturn('/my-subsite');

$page = new Page();
Expand Down
2 changes: 2 additions & 0 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\UX\StimulusBundle\StimulusBundle;

final class AppKernel extends Kernel
{
Expand All @@ -48,6 +49,7 @@ public function registerBundles(): iterable
new TwigBundle(),
new SecurityBundle(),
new KnpMenuBundle(),
new StimulusBundle(),
new SonataBlockBundle(),
new SonataDoctrineBundle(),
new SonataAdminBundle(),
Expand Down
4 changes: 2 additions & 2 deletions tests/Block/ContainerBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public function testFormBuilder(): void

$formBuilder = $this->createMock(FormBuilderInterface::class);
$form = new FormMapper(
$this->createStub(FormContractorInterface::class),
static::createStub(FormContractorInterface::class),
$formBuilder,
$this->createStub(AdminInterface::class)
static::createStub(AdminInterface::class)
);

$formBuilder->expects(static::exactly(2))->method('add');
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/PageManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testFixUrl(): void
{
$manager = new PageManager(
Page::class,
$this->createStub(ManagerRegistry::class),
static::createStub(ManagerRegistry::class),
new Slugify()
);

Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/SnapshotManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class SnapshotManagerTest extends TestCase

protected function setUp(): void
{
$this->managerRegistry = $this->createStub(ManagerRegistry::class);
$this->managerRegistry = static::createStub(ManagerRegistry::class);
$this->entityManager = $this->createMock(EntityManagerInterface::class);

$this->managerRegistry->method('getManagerForClass')->willReturn($this->entityManager);
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/Admin/SnapshotAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public static function provideFormsUrlsCases(): iterable
'uniqid' => 'snapshot',
], 'btn_update_and_list', [
'snapshot[enabled]' => false,
'snapshot[publicationDateStart]' => 'May 4, 2022, 8:00:00 AM',
'snapshot[publicationDateEnd]' => 'May 4, 2022, 9:00:00 AM',
'snapshot[publicationDateStart]' => '',
'snapshot[publicationDateEnd]' => '',
]];

yield 'Remove Snapshot' => ['/admin/tests/app/sonatapagesnapshot/1/delete', [], 'btn_delete'];
Expand Down

0 comments on commit 1a9bdc8

Please sign in to comment.