Skip to content

Commit

Permalink
PHPUnit: Use testsuites instead of groups
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Oct 1, 2024
1 parent cc7cb99 commit c16ca58
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run phpunit"
run: "composer phpunit"
run: "vendor/bin/phpunit --testsuite Unit"

integration-tests:
name: "Integration tests (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Collect code coverage with pcov and phpunit/phpunit"
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml"
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml --testsuite Unit"

- name: "Send code coverage report to Codecov.io"
uses: "codecov/codecov-action@v4"
Expand Down
7 changes: 5 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
</include>
</coverage>
<testsuites>
<testsuite name="SetonoSyliusMeilisearchPlugin Test Suite">
<directory>tests</directory>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Functional">
<directory>tests/Functional</directory>
</testsuite>
</testsuites>
<php>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

declare(strict_types=1);

namespace Setono\SyliusMeilisearchPlugin\Tests\Functional;
namespace Setono\SyliusMeilisearchPlugin\Tests\Functional\DataMapper\Product;

use Setono\SyliusMeilisearchPlugin\Config\Index;
use Setono\SyliusMeilisearchPlugin\DataMapper\Product\AttributesDataMapper;
use Setono\SyliusMeilisearchPlugin\Provider\IndexScope\IndexScope;
use Setono\SyliusMeilisearchPlugin\Tests\Application\Document\Product as ProductDocument;
use Setono\SyliusMeilisearchPlugin\Tests\Application\Entity\Product;
use Setono\SyliusMeilisearchPlugin\Tests\Functional\FunctionalTestCase;
use Sylius\Component\Core\Repository\ProductRepositoryInterface;

/** @group functional */
final class AttributesDataMapperTest extends FunctionalTestCase
{
public function testItMapsProductAttributesToDocumentProperties(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/DataMapper/Product/OptionsDataMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

declare(strict_types=1);

namespace Setono\SyliusMeilisearchPlugin\Tests\Functional;
namespace Setono\SyliusMeilisearchPlugin\Tests\Functional\DataMapper\Product;

use Setono\SyliusMeilisearchPlugin\Config\Index;
use Setono\SyliusMeilisearchPlugin\DataMapper\Product\OptionsDataMapper;
use Setono\SyliusMeilisearchPlugin\Provider\IndexScope\IndexScope;
use Setono\SyliusMeilisearchPlugin\Tests\Application\Document\Product as ProductDocument;
use Setono\SyliusMeilisearchPlugin\Tests\Application\Entity\Product;
use Setono\SyliusMeilisearchPlugin\Tests\Functional\FunctionalTestCase;
use Sylius\Component\Core\Repository\ProductRepositoryInterface;

/** @group functional */
final class OptionsDataMapperTest extends FunctionalTestCase
{
public function testItMapsProductOptionsToDocumentProperties(): void
Expand Down
1 change: 0 additions & 1 deletion tests/Functional/SearchFormBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Setono\SyliusMeilisearchPlugin\Form\Builder\SearchFormBuilderInterface;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;

/** @group functional */
final class SearchFormBuilderTest extends FunctionalTestCase
{
public function testItCreatesFormForSearchResultsWithProperlySortedFacetValues(): void
Expand Down
1 change: 0 additions & 1 deletion tests/Functional/SearchPaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Setono\SyliusMeilisearchPlugin\Engine\SearchRequest;
use Setono\SyliusMeilisearchPlugin\Tests\Functional\FunctionalTestCase;

/** @group functional */
final class SearchPaginationTest extends FunctionalTestCase
{
public function testItPaginatesSearchResults(): void
Expand Down
1 change: 0 additions & 1 deletion tests/Functional/SearchSortingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Sylius\Component\Core\Repository\ProductRepositoryInterface;
use Symfony\Component\Messenger\MessageBusInterface;

/** @group functional */
final class SearchSortingTest extends FunctionalTestCase
{
public function testItSortsSearchResultsByLowestPrice(): void
Expand Down
1 change: 0 additions & 1 deletion tests/Functional/SearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Setono\SyliusMeilisearchPlugin\Engine\SearchEngine;
use Setono\SyliusMeilisearchPlugin\Engine\SearchRequest;

/** @group functional */
final class SearchTest extends FunctionalTestCase
{
public function testItProvidesSearchResults(): void
Expand Down

0 comments on commit c16ca58

Please sign in to comment.