Skip to content

Commit 4137acc

Browse files
authored
Merge branch 'main' into bump-meilisearch-v1.0.0
2 parents fd39081 + 86a3d6f commit 4137acc

30 files changed

+154
-124
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
php-version: ['7.4', '8.0', '8.1']
20+
php-version: ['7.4', '8.0', '8.1', '8.2']
2121
include:
2222
- php-version: '7.4'
2323
sf-version: '4.4.*'
@@ -29,8 +29,10 @@ jobs:
2929
sf-version: '6.0.*'
3030
- php-version: '8.1'
3131
sf-version: '6.1.*'
32+
- php-version: '8.2'
33+
sf-version: '6.2.*'
3234

33-
name: integration-tests (PHP ${{ matrix.php-version }})
35+
name: integration-tests (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }})
3436
steps:
3537
- uses: actions/checkout@v3
3638
- name: Install PHP
@@ -58,7 +60,7 @@ jobs:
5860
- name: Install PHP
5961
uses: shivammathur/setup-php@v2
6062
with:
61-
php-version: '8.0'
63+
php-version: '8.1'
6264

6365
- name: Validate composer.json and composer.lock
6466
run: composer validate

bors.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
status = [
2-
'integration-tests (PHP 7.4)',
3-
'integration-tests (PHP 8.0)',
4-
'integration-tests (PHP 8.1)',
2+
'integration-tests (PHP 7.4) (Symfony 5.4.*)',
3+
'integration-tests (PHP 8.0) (Symfony 6.0.*)',
4+
'integration-tests (PHP 8.1) (Symfony 6.1.*)',
5+
'integration-tests (PHP 8.2) (Symfony 6.2.*)',
56
'Code style'
67
]
78
# 1 hour timeout

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"php": "^7.4|^8.0",
2222
"ext-json": "*",
2323
"doctrine/doctrine-bundle": "^2.4",
24-
"meilisearch/meilisearch-php": "^0.26.1",
24+
"meilisearch/meilisearch-php": "^1.0.0",
2525
"symfony/filesystem": "^4.4 || ^5.0 || ^6.0",
2626
"symfony/property-access": "^4.4 || ^5.0 || ^6.0",
2727
"symfony/serializer": "^4.4 || ^5.0 || ^6.0"
@@ -50,7 +50,7 @@
5050
},
5151
"autoload-dev": {
5252
"psr-4": {
53-
"Meilisearch\\Bundle\\Test\\": "tests/"
53+
"Meilisearch\\Bundle\\Tests\\": "tests/"
5454
}
5555
},
5656
"config": {

src/Resources/config/services.xml renamed to config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<services>
77
<defaults autowire="true" autoconfigure="true"/>
88

9-
<prototype namespace="Meilisearch\Bundle\Command\" resource="../../Command" />
9+
<prototype namespace="Meilisearch\Bundle\Command\" resource="../src/Command" />
1010

1111
<service id="search.search_indexer_subscriber"
1212
class="Meilisearch\Bundle\EventListener\DoctrineEventSubscriber"

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</include>
99
</coverage>
1010
<php>
11-
<env name="KERNEL_CLASS" value="Meilisearch\Bundle\Test\Kernel"/>
11+
<env name="KERNEL_CLASS" value="Meilisearch\Bundle\Tests\Kernel"/>
1212
<env name="APP_ENV" value="test"/>
1313
<env name="APP_DEBUG" value="false"/>
1414
<env name="MEILISEARCH_PREFIX" value="sf_phpunit_"/>

src/DependencyInjection/MeilisearchExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class MeilisearchExtension extends Extension
2424
*/
2525
public function load(array $configs, ContainerBuilder $container): void
2626
{
27-
$loader = new Loader\XmlFileLoader($container, new FileLocator(\dirname(__DIR__).'/Resources/config'));
27+
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../../config'));
2828
$loader->load('services.xml');
2929

3030
$configuration = new Configuration();

src/MeilisearchBundle.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@ public static function qualifiedVersion()
1717
{
1818
return sprintf('Meilisearch Symfony (v%s)', MeilisearchBundle::VERSION);
1919
}
20+
21+
public function getPath(): string
22+
{
23+
return \dirname(__DIR__);
24+
}
2025
}

tests/BaseKernelTestCase.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test;
5+
namespace Meilisearch\Bundle\Tests;
66

77
use Doctrine\ORM\EntityManagerInterface;
88
use Doctrine\ORM\Tools\SchemaTool;
99
use Meilisearch\Bundle\Collection;
1010
use Meilisearch\Bundle\SearchableEntity;
1111
use Meilisearch\Bundle\SearchService;
12-
use Meilisearch\Bundle\Test\Entity\Comment;
13-
use Meilisearch\Bundle\Test\Entity\Image;
14-
use Meilisearch\Bundle\Test\Entity\Link;
15-
use Meilisearch\Bundle\Test\Entity\ObjectId\DummyObjectId;
16-
use Meilisearch\Bundle\Test\Entity\Page;
17-
use Meilisearch\Bundle\Test\Entity\Post;
18-
use Meilisearch\Bundle\Test\Entity\Tag;
12+
use Meilisearch\Bundle\Tests\Entity\Comment;
13+
use Meilisearch\Bundle\Tests\Entity\Image;
14+
use Meilisearch\Bundle\Tests\Entity\Link;
15+
use Meilisearch\Bundle\Tests\Entity\ObjectId\DummyObjectId;
16+
use Meilisearch\Bundle\Tests\Entity\Page;
17+
use Meilisearch\Bundle\Tests\Entity\Post;
18+
use Meilisearch\Bundle\Tests\Entity\Tag;
1919
use Meilisearch\Exceptions\ApiException;
2020
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
2121

tests/Entity/Comment.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\ORM\Mapping as ORM;
88
use Symfony\Component\Serializer\Annotation\Groups;
99

1010
/**
1111
* @ORM\Entity
12+
*
1213
* @ORM\Table(name="comments")
1314
*/
1415
class Comment
1516
{
1617
/**
1718
* @ORM\Id
19+
*
1820
* @ORM\GeneratedValue
21+
*
1922
* @ORM\Column(type="integer", nullable=true)
23+
*
2024
* @Groups({"searchable"})
2125
*/
2226
private ?int $id = null;
2327

2428
/**
2529
* @ORM\ManyToOne(targetEntity="Post", inversedBy="comments")
30+
*
2631
* @ORM\JoinColumn(nullable=false)
2732
*/
2833
private ?Post $post = null;
@@ -36,6 +41,7 @@ class Comment
3641
* max=10000,
3742
* maxMessage="comment.too_long"
3843
* )
44+
*
3945
* @Groups({"searchable"})
4046
*/
4147
private $content;
@@ -44,6 +50,7 @@ class Comment
4450
* @var \DateTime
4551
*
4652
* @ORM\Column(type="datetime")
53+
*
4754
* @Groups({"searchable"})
4855
*/
4956
private $publishedAt;

tests/Entity/ContentAggregator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\ORM\Mapping as ORM;
88
use Meilisearch\Bundle\Entity\Aggregator;

tests/Entity/EmptyAggregator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\ORM\Mapping as ORM;
88
use Meilisearch\Bundle\Entity\Aggregator;

tests/Entity/Image.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\ORM\Mapping as ORM;
88

@@ -13,7 +13,9 @@ class Image
1313
{
1414
/**
1515
* @ORM\Id
16+
*
1617
* @ORM\GeneratedValue
18+
*
1719
* @ORM\Column(type="integer")
1820
*/
1921
private ?int $id;

tests/Entity/Link.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\ORM\Mapping as ORM;
88
use Meilisearch\Bundle\Searchable;
@@ -16,6 +16,7 @@ class Link implements NormalizableInterface
1616
{
1717
/**
1818
* @ORM\Id
19+
*
1920
* @ORM\Column(type="integer")
2021
*/
2122
private int $id;

tests/Entity/ObjectId/DummyObjectId.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity\ObjectId;
5+
namespace Meilisearch\Bundle\Tests\Entity\ObjectId;
66

77
class DummyObjectId
88
{

tests/Entity/Page.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,37 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\ORM\Mapping as ORM;
88
use Symfony\Component\Serializer\Annotation\Groups;
99

1010
/**
1111
* @ORM\Entity
12+
*
1213
* @ORM\Table(name="pages")
1314
*/
1415
class Page
1516
{
1617
/**
1718
* @ORM\Id
19+
*
1820
* @ORM\GeneratedValue(strategy="NONE")
21+
*
1922
* @ORM\Column(type="object")
2023
*/
2124
private $id = null;
2225

2326
/**
2427
* @ORM\Column(type="string", nullable=true)
28+
*
2529
* @Groups({"searchable"})
2630
*/
2731
private ?string $title = null;
2832

2933
/**
3034
* @ORM\Column(type="text", nullable=true)
35+
*
3136
* @Groups({"searchable"})
3237
*/
3338
private ?string $content = null;

tests/Entity/Post.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\Common\Collections\ArrayCollection;
88
use Doctrine\Common\Collections\Collection;
@@ -11,34 +11,41 @@
1111

1212
/**
1313
* @ORM\Entity
14+
*
1415
* @ORM\Table(name="posts")
1516
*/
1617
class Post
1718
{
1819
/**
1920
* @ORM\Id
21+
*
2022
* @ORM\GeneratedValue
23+
*
2124
* @ORM\Column(type="integer")
25+
*
2226
* @Groups({"searchable"})
2327
* ^ Note that Groups work on private properties
2428
*/
2529
private ?int $id = null;
2630

2731
/**
2832
* @ORM\Column(type="string", nullable=true)
33+
*
2934
* @Groups({"searchable"})
3035
* ^ Note that Groups work on private properties
3136
*/
3237
private ?string $title = null;
3338

3439
/**
3540
* @ORM\Column(type="text", nullable=true)
41+
*
3642
* @Groups({"searchable"})
3743
*/
3844
private ?string $content = null;
3945

4046
/**
4147
* @ORM\Column(type="datetime")
48+
*
4249
* @Groups({"searchable"})
4350
*/
4451
private ?\DateTime $publishedAt = null;
@@ -51,7 +58,9 @@ class Post
5158
* mappedBy="post",
5259
* orphanRemoval=true
5360
* )
61+
*
5462
* @ORM\OrderBy({"publishedAt": "DESC"})
63+
*
5564
* @Groups({"searchable"})
5665
*/
5766
private $comments;

tests/Entity/Tag.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Entity;
5+
namespace Meilisearch\Bundle\Tests\Entity;
66

77
use Doctrine\ORM\Mapping as ORM;
88
use Meilisearch\Bundle\Searchable;
@@ -17,6 +17,7 @@ class Tag implements NormalizableInterface
1717
{
1818
/**
1919
* @ORM\Id
20+
*
2021
* @ORM\Column(type="integer", nullable=true)
2122
*/
2223
private ?int $id;

tests/Integration/AggregatorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
declare(strict_types=1);
44

5-
namespace Meilisearch\Bundle\Test\Integration;
5+
namespace Meilisearch\Bundle\Tests\Integration;
66

77
use Meilisearch\Bundle\Exception\EntityNotFoundInObjectID;
88
use Meilisearch\Bundle\Exception\InvalidEntityForAggregator;
9-
use Meilisearch\Bundle\Test\BaseKernelTestCase;
10-
use Meilisearch\Bundle\Test\Entity\ContentAggregator;
11-
use Meilisearch\Bundle\Test\Entity\EmptyAggregator;
12-
use Meilisearch\Bundle\Test\Entity\Post;
9+
use Meilisearch\Bundle\Tests\BaseKernelTestCase;
10+
use Meilisearch\Bundle\Tests\Entity\ContentAggregator;
11+
use Meilisearch\Bundle\Tests\Entity\EmptyAggregator;
12+
use Meilisearch\Bundle\Tests\Entity\Post;
1313
use Symfony\Component\Serializer\Serializer;
1414

1515
class AggregatorTest extends BaseKernelTestCase

0 commit comments

Comments
 (0)