Skip to content

Commit 21a25a2

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

File tree

3 files changed

+96
-8
lines changed

3 files changed

+96
-8
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public static function inputProvider(): \Generator
9696
yield NumberType::class => [NumberType::class, 1234.56, 'text'];
9797
yield PasswordType::class => [PasswordType::class, null, 'password'];
9898
yield SearchType::class => [SearchType::class, '1', 'search'];
99-
yield UrlType::class => [UrlType::class, 'https://example.com', 'text'];
10099
yield TelType::class => [TelType::class, '0123456789', 'tel'];
101100
yield ColorType::class => [ColorType::class, '#ffffff', 'color'];
102101
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace FormLayout;
6+
7+
use PHPUnit\Framework\Attributes\DataProvider;
8+
use Symfony\Component\Form\Extension\Core\Type\ColorType;
9+
use Symfony\Component\Form\Extension\Core\Type\EmailType;
10+
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
11+
use Symfony\Component\Form\Extension\Core\Type\NumberType;
12+
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
13+
use Symfony\Component\Form\Extension\Core\Type\SearchType;
14+
use Symfony\Component\Form\Extension\Core\Type\TelType;
15+
use Symfony\Component\Form\Extension\Core\Type\TextType;
16+
use Symfony\Component\Form\Extension\Core\Type\UrlType;
17+
use Symfony\Component\Form\FormError;
18+
use TalesFromADev\FlowbiteBundle\Tests\AbstractFlowbiteLayoutTestCase;
19+
20+
final class UrlLayoutTest extends AbstractFlowbiteLayoutTestCase
21+
{
22+
public function testInputWithDefaultProtocol()
23+
{
24+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
25+
26+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['default_protocol' => 'http']);
27+
28+
$this->assertWidgetMatchesXpath($form->createView(), [],
29+
'/input
30+
[@type="text"]
31+
[@name="name"]
32+
[@id="name"]
33+
[@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"]
34+
[@value="http://www.example.com?foo1=bar1&foo2=bar2"]
35+
[@inputmode="url"]
36+
'
37+
);
38+
}
39+
40+
public function testInputWithoutDefaultProtocol()
41+
{
42+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
43+
44+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['default_protocol' => null]);
45+
46+
$this->assertWidgetMatchesXpath($form->createView(), [],
47+
'/input
48+
[@type="url"]
49+
[@name="name"]
50+
[@id="name"]
51+
[@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"]
52+
[@value="http://www.example.com?foo1=bar1&foo2=bar2"]
53+
'
54+
);
55+
}
56+
57+
public function testInputError(): void
58+
{
59+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
60+
61+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['default_protocol' => null]);
62+
$form->addError(new FormError('[trans]Error message[/trans]'));
63+
$form->submit([]);
64+
65+
$this->assertWidgetMatchesXpath($form->createView(), [],
66+
'/input
67+
[@type="url"]
68+
[@name="name"]
69+
[@id="name"]
70+
[@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"]
71+
'
72+
);
73+
}
74+
75+
public function testInputDisabled(): void
76+
{
77+
$url = 'http://www.example.com?foo1=bar1&foo2=bar2';
78+
79+
$form = $this->factory->createNamed('name', UrlType::class, $url, ['disabled' => true]);
80+
$form->submit([]);
81+
82+
$this->assertWidgetMatchesXpath($form->createView(), [],
83+
'/input
84+
[@type="url"]
85+
[@name="name"]
86+
[@id="name"]
87+
[@disabled="disabled"]
88+
[@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"]
89+
[@value="http://www.example.com?foo1=bar1&foo2=bar2"]
90+
'
91+
);
92+
}
93+
}

0 commit comments

Comments
 (0)