Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:

- name: Remove symfony/clock for PHP < 8.1
if: ${{ matrix.php-version < '8.1' }}
run: composer remove --dev symfony/clock --no-update
run: |
composer remove --dev symfony/clock --no-update
composer remove --dev twig/twig --no-update

- name: Install dependencies with Composer
uses: ramsey/composer-install@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:

- name: Remove symfony/clock for PHP < 8.1
if: ${{ matrix.php-version < '8.1' }}
run: composer remove --dev symfony/clock --no-update
run: |
composer remove --dev symfony/clock --no-update
composer remove --dev twig/twig --no-update

- name: Install dependencies with Composer
uses: ramsey/composer-install@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:

- name: Remove symfony/clock for PHP < 8.1
if: ${{ matrix.php-version < '8.1' }}
run: composer remove --dev symfony/clock --no-update
run: |
composer remove --dev symfony/clock --no-update
composer remove --dev twig/twig --no-update

- name: Install dependencies with Composer
uses: ramsey/composer-install@v4
Expand Down
8 changes: 8 additions & 0 deletions tests/Twig/SerializerExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@
use JMS\Serializer\Twig\SerializerRuntimeExtension;
use JMS\Serializer\Twig\SerializerRuntimeHelper;
use PHPUnit\Framework\TestCase;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;

class SerializerExtensionTest extends TestCase
{
protected function setUp(): void
{
if (!class_exists(Twig\Extension\AbstractExtension::class)) {
$this->markTestSkipped('Twig is not available');
}
}

public function testSerialize()
{
$mockSerializer = $this->getMockBuilder('JMS\Serializer\SerializerInterface')->getMock();
Expand All @@ -27,7 +35,7 @@
self::assertEquals('jms_serializer', $serializerExtension->getName());

$filters = $serializerExtension->getFilters();
self::assertInstanceOf(TwigFilter::class, $filters[0]);

Check failure on line 38 in tests/Twig/SerializerExtensionTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Class Twig\TwigFilter not found.

Check failure on line 38 in tests/Twig/SerializerExtensionTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Class Twig\TwigFilter not found.
self::assertSame('serialize', $filters[0]->getName());

self::assertEquals(
Expand Down
Loading