Skip to content

Commit ccb3a0c

Browse files
committed
💚 Use stable versions for Symfony 7.4 / 8.0 in CI
1 parent c6a12c7 commit ccb3a0c

File tree

3 files changed

+87
-9
lines changed

3 files changed

+87
-9
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,13 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
20-
symfony-version: [ '6.4.*', '7.3.*' ]
20+
symfony-version: [ '6.4.*', '7.4.*' ]
2121
exclude:
2222
- php-version: '8.1'
23-
symfony-version: '7.3.*'
23+
symfony-version: '7.4.*'
2424
include:
25-
- php-version: '8.2'
26-
symfony-version: '7.4.0-RC3'
27-
minimum-stability: 'RC'
2825
- php-version: '8.4'
29-
symfony-version: '8.0.0-RC3'
30-
minimum-stability: 'RC'
26+
symfony-version: '8.0.*'
3127

3228
steps:
3329
- uses: actions/checkout@v4

‎tests/FormLayout/TextLayoutTest.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Symfony\Component\Form\Extension\Core\Type\SearchType;
1414
use Symfony\Component\Form\Extension\Core\Type\TelType;
1515
use Symfony\Component\Form\Extension\Core\Type\TextType;
16-
use Symfony\Component\Form\Extension\Core\Type\UrlType;
1716
use Symfony\Component\Form\FormError;
1817
use TalesFromADev\FlowbiteBundle\Tests\AbstractFlowbiteLayoutTestCase;
1918

@@ -96,7 +95,6 @@ public static function inputProvider(): \Generator
9695
yield NumberType::class => [NumberType::class, 1234.56, 'text'];
9796
yield PasswordType::class => [PasswordType::class, null, 'password'];
9897
yield SearchType::class => [SearchType::class, '1', 'search'];
99-
yield UrlType::class => [UrlType::class, 'https://example.com', 'text'];
10098
yield TelType::class => [TelType::class, '0123456789', 'tel'];
10199
yield ColorType::class => [ColorType::class, '#ffffff', 'color'];
102100
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace FormLayout;
6+
7+
use Symfony\Component\Form\Extension\Core\Type\UrlType;
8+
use Symfony\Component\Form\FormError;
9+
use TalesFromADev\FlowbiteBundle\Tests\AbstractFlowbiteLayoutTestCase;
10+
11+
final class UrlLayoutTest extends AbstractFlowbiteLayoutTestCase
12+
{
13+
public function testInputWithDefaultProtocol()
14+
{
15+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
16+
17+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['default_protocol' => 'http']);
18+
19+
$this->assertWidgetMatchesXpath($form->createView(), [],
20+
'/input
21+
[@type="text"]
22+
[@name="name"]
23+
[@id="name"]
24+
[@class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base block w-full px-3 py-2.5 shadow-xs focus:ring-brand focus:border-brand placeholder:text-body"]
25+
[@value="http://www.example.com?foo1=bar1&foo2=bar2"]
26+
[@inputmode="url"]
27+
'
28+
);
29+
}
30+
31+
public function testInputWithoutDefaultProtocol()
32+
{
33+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
34+
35+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['default_protocol' => null]);
36+
37+
$this->assertWidgetMatchesXpath($form->createView(), [],
38+
'/input
39+
[@type="url"]
40+
[@name="name"]
41+
[@id="name"]
42+
[@class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base block w-full px-3 py-2.5 shadow-xs focus:ring-brand focus:border-brand placeholder:text-body"]
43+
[@value="http://www.example.com?foo1=bar1&foo2=bar2"]
44+
'
45+
);
46+
}
47+
48+
public function testInputError(): void
49+
{
50+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
51+
52+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['default_protocol' => null]);
53+
$form->addError(new FormError('[trans]Error message[/trans]'));
54+
$form->submit([]);
55+
56+
$this->assertWidgetMatchesXpath($form->createView(), [],
57+
'/input
58+
[@type="url"]
59+
[@name="name"]
60+
[@id="name"]
61+
[@class="border text-sm rounded-base block w-full px-3 py-2.5 shadow-xs bg-danger-soft border-danger-subtle text-fg-danger-strong focus:ring-danger focus:border-danger placeholder:text-fg-danger-strong"]
62+
'
63+
);
64+
}
65+
66+
public function testInputDisabled(): void
67+
{
68+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
69+
70+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['default_protocol' => null, 'disabled' => true]);
71+
$form->submit([]);
72+
73+
$this->assertWidgetMatchesXpath($form->createView(), [],
74+
'/input
75+
[@type="url"]
76+
[@name="name"]
77+
[@id="name"]
78+
[@disabled="disabled"]
79+
[@class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base block w-full px-3 py-2.5 shadow-xs focus:ring-brand focus:border-brand placeholder:text-body disabled:text-fg-disabled disabled:cursor-not-allowed"]
80+
[@value="http://www.example.com?foo1=bar1&foo2=bar2"]
81+
'
82+
);
83+
}
84+
}

0 commit comments

Comments
 (0)