diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index 4c8b1bde1..8371e99ef 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 570ab5703..f2d51a86d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 7e51144c2..cddb5d811 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -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 diff --git a/tests/Twig/SerializerExtensionTest.php b/tests/Twig/SerializerExtensionTest.php index 79c729f4a..bf3a60750 100644 --- a/tests/Twig/SerializerExtensionTest.php +++ b/tests/Twig/SerializerExtensionTest.php @@ -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();