File tree Expand file tree Collapse file tree 5 files changed +19
-33
lines changed Expand file tree Collapse file tree 5 files changed +19
-33
lines changed Original file line number Diff line number Diff line change 16
16
],
17
17
"require" : {
18
18
"php" : " ^8.1" ,
19
- "symfony-cmf/routing" : " ^3.0" ,
19
+ "symfony-cmf/routing" : " ^3.0.3 " ,
20
20
"symfony/framework-bundle" : " ^6.4 || ^7.0"
21
21
},
22
22
"require-dev" : {
36
36
"symfony/translation" : " ^6.4 || ^7.0" ,
37
37
"symfony/validator" : " ^6.4 || ^7.0" ,
38
38
"symfony/twig-bundle" : " ^6.4 || ^7.0" ,
39
- "symfony-cmf/testing" : " dev-sf7 as 4.2.0 " ,
39
+ "symfony-cmf/testing" : " dev-fix-test-kernel as 5.0.2 " ,
40
40
"twig/twig" : " ^2.4.4 || ^3.0"
41
41
},
42
42
"suggest" : {
69
69
"allow-plugins" : {
70
70
"composer/package-versions-deprecated" : true
71
71
}
72
- },
73
- "minimum-stability" : " dev"
72
+ }
74
73
}
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
-
3
- <!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
4
2
<phpunit
5
3
colors =" true"
6
4
bootstrap =" vendor/symfony-cmf/testing/bootstrap/bootstrap.php"
5
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
6
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd"
7
7
>
8
-
9
8
<testsuites >
10
9
<testsuite name =" unit tests" >
11
10
<directory >./tests/Unit</directory >
12
11
</testsuite >
13
-
14
12
<testsuite name =" functional tests with phpcr" >
15
13
<directory >./tests/Functional</directory >
16
14
<exclude >./tests/Functional/Doctrine/Orm</exclude >
17
15
</testsuite >
18
-
19
16
<testsuite name =" functional tests with orm" >
20
17
<directory >./tests/Functional/Doctrine/Orm</directory >
21
18
</testsuite >
22
19
</testsuites >
23
20
24
- <filter >
25
- <whitelist addUncoveredFilesFromWhitelist = " true " >
21
+ <coverage includeUncoveredFiles = " true " >
22
+ <include >
26
23
<directory >src/</directory >
27
- < exclude >
28
- < directory >Resources/</ directory >
29
- </ exclude >
30
- </whitelist >
31
- </filter >
24
+ </ include >
25
+ < exclude >
26
+ <directory >src/Resources/</ directory >
27
+ </exclude >
28
+ </coverage >
32
29
33
30
<php >
34
- <env name =" KERNEL_CLASS" value =" \Symfony\Cmf\Bundle\RoutingBundle\Tests\Fixtures\App\Kernel" />
31
+ <env name =" KERNEL_CLASS" value =" \Symfony\Cmf\Bundle\RoutingBundle\Tests\Fixtures\App\Kernel" />
35
32
</php >
36
33
</phpunit >
Original file line number Diff line number Diff line change 17
17
* {@inheritdoc}
18
18
*
19
19
* Provides a redirect route stored in the Doctrine ORM and used as content for generic route to provide redirects
20
+ *
21
+ * @property int $id
20
22
*/
21
23
class RedirectRoute extends RedirectRouteModel
22
24
{
23
- /**
24
- * Unique id of this route.
25
- *
26
- * @var int
27
- */
28
- protected $ id ;
29
-
30
25
protected string $ serialisedParameters ;
31
26
32
27
/**
Original file line number Diff line number Diff line change 17
17
18
18
class Kernel extends TestKernel
19
19
{
20
- public function configure ()
20
+ public function configure (): void
21
21
{
22
22
$ this ->requireBundleSet ('default ' );
23
23
@@ -39,7 +39,7 @@ public function configure()
39
39
}
40
40
}
41
41
42
- public function registerContainerConfiguration (LoaderInterface $ loader )
42
+ public function registerContainerConfiguration (LoaderInterface $ loader ): void
43
43
{
44
44
$ loader ->load (__DIR__ .'/config/config_ ' .$ this ->environment .'.php ' );
45
45
}
Original file line number Diff line number Diff line change 14
14
use Symfony \Cmf \Bundle \RoutingBundle \Controller \RedirectController ;
15
15
use Symfony \Cmf \Bundle \RoutingBundle \Doctrine \Orm \RedirectRoute ;
16
16
use Symfony \Cmf \Bundle \RoutingBundle \Doctrine \Orm \Route ;
17
- use Symfony \Component \HttpFoundation \RedirectResponse ;
18
17
19
18
class RedirectRouteTest extends OrmTestCase
20
19
{
21
- private $ repository ;
22
-
23
- private $ controller ;
20
+ private RedirectController $ controller ;
24
21
25
22
public function setUp (): void
26
23
{
27
24
parent ::setUp ();
28
25
$ this ->clearDb (Route::class);
29
26
$ this ->clearDb (RedirectRoute::class);
30
27
31
- $ this ->repository = $ this ->getContainer ()->get ('cmf_routing.route_provider ' );
32
28
$ this ->controller = new RedirectController ($ this ->getContainer ()->get ('router ' ));
33
29
}
34
30
35
- public function testRedirectDoctrine ()
31
+ public function testRedirectDoctrine (): void
36
32
{
37
33
$ route = $ this ->createRoute ('route1 ' , '/test ' );
38
34
@@ -52,7 +48,6 @@ public function testRedirectDoctrine()
52
48
53
49
$ response = $ this ->controller ->redirectAction ($ redirectRoute ->getContent ());
54
50
55
- $ this ->assertInstanceOf (RedirectResponse::class, $ response );
56
51
$ this ->assertSame (301 , $ response ->getStatusCode ());
57
52
$ this ->assertSame ('http://localhost/test ' , $ response ->getTargetUrl ());
58
53
}
You can’t perform that action at this time.
0 commit comments