Skip to content

Commit

Permalink
advanced renderPagesList stringToSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Nov 19, 2023
1 parent 327e76c commit 51c949b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/Resources/config/packages/security.php
Expand Up @@ -51,13 +51,13 @@
'http_basic' => [
'realm' => 'Secured Area',
],
'custom_authenticator' => 'Pushword\\Core\\Security\\LoginFormAuthenticator',
'entry_point' => 'Pushword\\Core\\Security\\LoginFormAuthenticator',
'custom_authenticator' => \Pushword\Core\Security\LoginFormAuthenticator::class,
'entry_point' => \Pushword\Core\Security\LoginFormAuthenticator::class,
'logout' => [
'path' => 'pushword_logout',
],
'remember_me' => [
'lifetime' => 31536000,
'lifetime' => 31_536_000,
'always_remember_me' => true,
'secret' => '%kernel.secret%',
],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Twig/StringToSearch.php
Expand Up @@ -10,7 +10,7 @@ class StringToSearch
/** @var array<int, string|array{0: string, 1: string, 2: string|int|float|int[]}> */
private array $where = [];

public function __construct(private readonly string $search, private ?PageInterface $currentPage)
public function __construct(private readonly string $search, private readonly ?PageInterface $currentPage)
{
}

Expand Down
18 changes: 18 additions & 0 deletions packages/core/tests/Twig/AppExtensionTest.php
@@ -0,0 +1,18 @@
<?php

namespace Pushword\Core\Tests\Service;

use Pushword\Core\Twig\StringToSearch;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

class AppExtensionTest extends KernelTestCase
{
public function testStringToSearch()
{
$this->assertSame([['mainContent', 'LIKE', '%<!--blog-->%']], (new StringToSearch('comment:blog', null))->retrieve());
$this->assertSame(
[['slug', 'LIKE', 'blog'], 'OR', ['mainContent', 'LIKE', '%a%']],
(new StringToSearch('slug:blog OR a', null))->retrieve()
);
}
}
Binary file modified packages/skeleton/var/app.db
Binary file not shown.

0 comments on commit 51c949b

Please sign in to comment.