Skip to content
Merged
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
5 changes: 0 additions & 5 deletions .github/workflows/.utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ before_composer_install() {
composer require symfony/property-info:7.1.* symfony/type-info:7.2.* --no-update
return $?
;;
8.4)
# Install PropertyInfo 7.4 (deprecate PropertyTypeExtractorInterface::getTypes from 7.3) and TypeInfo 7.4, but for Symfony 8 compatibility
composer require symfony/property-info:7.4.* symfony/type-info:7.4.* --no-update
return $?
;;
esac

# Install the best TypeInfo version available
Expand Down
1 change: 1 addition & 0 deletions src/Icons/tests/Unit/IconRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ public static function provideRenderIconWithIconSetAttributes(): iterable
/**
* @dataProvider provideRenderIconWithSuffixCases
*/
#[DataProvider('provideRenderIconWithSuffixCases')]
public function testRenderIconWithSuffixes(string $name, string $expectedSvg)
{
$registry = $this->createRegistry([
Expand Down
54 changes: 0 additions & 54 deletions src/LiveComponent/tests/Unit/Attribute/AsLiveComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\UX\LiveComponent\Tests\Unit\Attribute;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveAction;
use Symfony\UX\LiveComponent\Attribute\LiveListener;
Expand Down Expand Up @@ -179,54 +178,6 @@ public function testCanCheckIfMethodIsAllowed()
$this->assertFalse(AsLiveComponent::isActionAllowed($component, 'method2'));
$this->assertTrue(AsLiveComponent::isActionAllowed($component, 'aListenerActionMethod'));
}

/**
* @group legacy
*/
public function testBackwardsCompatibilityWithAllPositionalArgumentsOldSignature()
{
// Old signature (before https://github.com/symfony/ux/pull/2251): $csrf was at position 6
// Position: 1=name, 2=template, 3=defaultAction, 4=exposePublicProps, 5=attributesVar, 6=csrf, 7=route, 8=method, 9=urlReferenceType
$attribute = new AsLiveComponent(
'my_component',
'components/my.html.twig',
'__invoke',
true,
'attrs',
false,
'my_custom_route',
'get',
UrlGeneratorInterface::ABSOLUTE_URL
);

$this->assertFalse($attribute->csrf);
$this->assertSame('my_custom_route', $attribute->route);
$this->assertSame('get', $attribute->method);
$this->assertSame(UrlGeneratorInterface::ABSOLUTE_URL, $attribute->urlReferenceType);
$this->assertNull($attribute->fetchCredentials); // fetchCredentials didn't exist in old signature
}

public function testNewSignatureWithAllPositionalArguments()
{
// New signature (after https://github.com/symfony/ux/pull/2251): $fetchCredentials at position 9, $csrf at position 10
// Position: 1=name, 2=template, 3=defaultAction, 4=exposePublicProps, 5=attributesVar, 6=route, 7=method, 8=urlReferenceType, 9=fetchCredentials, 10=csrf
$attribute = new AsLiveComponent(
'my_component',
'components/my.html.twig',
'__invoke',
true,
'attrs',
'my_custom_route',
'get',
UrlGeneratorInterface::ABSOLUTE_URL,
'include'
);

$this->assertSame('my_custom_route', $attribute->route);
$this->assertSame('get', $attribute->method);
$this->assertSame(UrlGeneratorInterface::ABSOLUTE_URL, $attribute->urlReferenceType);
$this->assertSame('include', $attribute->fetchCredentials);
}
}

#[AsLiveComponent]
Expand All @@ -242,8 +193,3 @@ public function method(): bool
return true;
}
}

#[AsLiveComponent(method: 'get')]
class GetMethodComponent
{
}
1 change: 0 additions & 1 deletion src/Map/phpunit.dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<php>
<ini name="error_reporting" value="-1"/>
<env name="SHELL_VERBOSITY" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
</php>

<testsuites>
Expand Down
10 changes: 5 additions & 5 deletions src/Map/src/Bridge/Google/tests/GoogleRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function provideTestRenderMap(): iterable
];

yield 'with all markers removed with removeAllMarkers()' => [
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), apiKey: 'api_key'),
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), key: 'api_key'),
'map' => (new Map())
->center(new Point(48.8566, 2.3522))
->zoom(12)
Expand Down Expand Up @@ -105,7 +105,7 @@ public static function provideTestRenderMap(): iterable
];

yield 'with all polygons removed with removeAllPolygons()' => [
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), apiKey: 'api_key'),
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), key: 'api_key'),
'map' => (new Map())
->center(new Point(48.8566, 2.3522))
->zoom(12)
Expand All @@ -124,7 +124,7 @@ public static function provideTestRenderMap(): iterable
];

yield 'with all polylines removed with removeAllPolylines()' => [
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), apiKey: 'api_key'),
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), key: 'api_key'),
'map' => (new Map())
->center(new Point(48.8566, 2.3522))
->zoom(12)
Expand All @@ -143,7 +143,7 @@ public static function provideTestRenderMap(): iterable
];

yield 'with all circles removed with removeAllCircles()' => [
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), apiKey: 'api_key'),
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), key: 'api_key'),
'map' => (new Map())
->center(new Point(48.8566, 2.3522))
->zoom(12)
Expand All @@ -162,7 +162,7 @@ public static function provideTestRenderMap(): iterable
];

yield 'with all rectangles removed with removeAllRectangles()' => [
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), apiKey: 'api_key'),
'renderer' => new GoogleRenderer(new StimulusHelper(null), new UxIconRenderer(null), key: 'api_key'),
'map' => (new Map())
->center(new Point(48.8566, 2.3522))
->zoom(12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Run "php vendor/bin/phpunit -d --update-snapshots" to update the snapshot. -->
<div
data-controller="symfony--ux-google-map--map"
data-symfony--ux-google-map--map-provider-options-value="{&quot;apiKey&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-provider-options-value="{&quot;key&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-center-value="{&quot;lat&quot;:48.8566,&quot;lng&quot;:2.3522}"
data-symfony--ux-google-map--map-zoom-value="12"
data-symfony--ux-google-map--map-fit-bounds-to-markers-value="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Run "php vendor/bin/phpunit -d --update-snapshots" to update the snapshot. -->
<div
data-controller="symfony--ux-google-map--map"
data-symfony--ux-google-map--map-provider-options-value="{&quot;apiKey&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-provider-options-value="{&quot;key&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-center-value="{&quot;lat&quot;:48.8566,&quot;lng&quot;:2.3522}"
data-symfony--ux-google-map--map-zoom-value="12"
data-symfony--ux-google-map--map-fit-bounds-to-markers-value="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Run "php vendor/bin/phpunit -d --update-snapshots" to update the snapshot. -->
<div
data-controller="symfony--ux-google-map--map"
data-symfony--ux-google-map--map-provider-options-value="{&quot;apiKey&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-provider-options-value="{&quot;key&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-center-value="{&quot;lat&quot;:48.8566,&quot;lng&quot;:2.3522}"
data-symfony--ux-google-map--map-zoom-value="12"
data-symfony--ux-google-map--map-fit-bounds-to-markers-value="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Run "php vendor/bin/phpunit -d --update-snapshots" to update the snapshot. -->
<div
data-controller="symfony--ux-google-map--map"
data-symfony--ux-google-map--map-provider-options-value="{&quot;apiKey&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-provider-options-value="{&quot;key&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-center-value="{&quot;lat&quot;:48.8566,&quot;lng&quot;:2.3522}"
data-symfony--ux-google-map--map-zoom-value="12"
data-symfony--ux-google-map--map-fit-bounds-to-markers-value="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Run "php vendor/bin/phpunit -d --update-snapshots" to update the snapshot. -->
<div
data-controller="symfony--ux-google-map--map"
data-symfony--ux-google-map--map-provider-options-value="{&quot;apiKey&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-provider-options-value="{&quot;key&quot;:&quot;api_key&quot;}"
data-symfony--ux-google-map--map-center-value="{&quot;lat&quot;:48.8566,&quot;lng&quot;:2.3522}"
data-symfony--ux-google-map--map-zoom-value="12"
data-symfony--ux-google-map--map-fit-bounds-to-markers-value="false"
Expand Down
5 changes: 2 additions & 3 deletions src/Native/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
],
"homepage": "https://symfony.com",
"require": {
"php": ">=8.1",
"php": ">=8.2",
"symfony/asset": "^6.4|^7.0|^8.0",
"symfony/filesystem": "^6.4|^7.0|^8.0",
"symfony/process": "^6.4|^7.0|^8.0",
"symfony/stimulus-bundle": "^2.18.1"
},
"require-dev": {
"phpunit/phpunit": "^9.6.22",
"symfony/phpunit-bridge": "^7.2|^8.0",
"phpunit/phpunit": "^11.1|^12.0",
"symfony/browser-kit": "^6.4|^7.0|^8.0",
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
"symfony/maker-bundle": "^1.0"
Expand Down
27 changes: 18 additions & 9 deletions src/Native/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,38 @@
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="tests/autoload.php"
bootstrap="tests/bootstrap.php"
failOnDeprecation="true"
failOnRisky="true"
failOnWarning="true"
cacheDirectory=".phpunit.cache"
>
<php>
<ini name="error_reporting" value="-1"/>
<env name="SHELL_VERBOSITY" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<env name="KERNEL_CLASS" value="Symfony\UX\Native\Tests\AppKernel"/>
</php>

<testsuites>
<testsuite name="Symfony UX Native Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<coverage>

<source
ignoreSuppressionOfDeprecations="true"
ignoreIndirectDeprecations="true"
restrictNotices="true"
restrictWarnings="true"
>
<include>
<directory>./src</directory>
<directory>src</directory>
</include>
</coverage>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>

<deprecationTrigger>
<function>trigger_deprecation</function>
</deprecationTrigger>
</source>
</phpunit>
17 changes: 17 additions & 0 deletions src/Native/tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\ErrorHandler\ErrorHandler;

require __DIR__.'/../vendor/autoload.php';

// @see https://github.com/symfony/symfony/issues/53812
ErrorHandler::register(null, false);
1 change: 0 additions & 1 deletion src/Notify/phpunit.dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<php>
<ini name="error_reporting" value="-1"/>
<env name="SHELL_VERBOSITY" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
</php>

<testsuites>
Expand Down
1 change: 0 additions & 1 deletion src/Toolkit/phpunit.dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<php>
<ini name="error_reporting" value="-1"/>
<env name="SHELL_VERBOSITY" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<env name="KERNEL_CLASS" value="Symfony\UX\Toolkit\Tests\Fixtures\Kernel"/>
</php>

Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/src/ComponentTemplateFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function findAnonymousComponentTemplate(string $name): ?string
}

$template = '@'.$parts[0].'/components/'.$parts[1].'/index.html.twig';
if ($loader->exists($template)) {
if ($this->loader->exists($template)) {
return $template;
}

Expand Down
Loading