Skip to content

Commit

Permalink
bump routing
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Apr 3, 2024
1 parent c3c135e commit 54bfbe4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 30 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"require": {
"php": "^8.1",
"symfony-cmf/routing": "^3.0",
"symfony-cmf/routing": "^3.0.3",
"symfony/framework-bundle": "^6.4 || ^7.0"
},
"require-dev": {
Expand All @@ -36,7 +36,7 @@
"symfony/translation": "^6.4 || ^7.0",
"symfony/validator": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony-cmf/testing": "dev-sf7 as 4.2.0",
"symfony-cmf/testing": "^5.0.0",
"twig/twig": "^2.4.4 || ^3.0"
},
"suggest": {
Expand Down Expand Up @@ -69,6 +69,5 @@
"allow-plugins": {
"composer/package-versions-deprecated": true
}
},
"minimum-stability": "dev"
}
}
23 changes: 10 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
colors="true"
bootstrap="vendor/symfony-cmf/testing/bootstrap/bootstrap.php"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>

<testsuites>
<testsuite name="unit tests">
<directory>./tests/Unit</directory>
</testsuite>

<testsuite name="functional tests with phpcr">
<directory>./tests/Functional</directory>
<exclude>./tests/Functional/Doctrine/Orm</exclude>
</testsuite>

<testsuite name="functional tests with orm">
<directory>./tests/Functional/Doctrine/Orm</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<coverage includeUncoveredFiles="true">
<include>
<directory>src/</directory>
<exclude>
<directory>Resources/</directory>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory>src/Resources/</directory>
</exclude>
</coverage>

<php>
<env name="KERNEL_CLASS" value="\Symfony\Cmf\Bundle\RoutingBundle\Tests\Fixtures\App\Kernel" />
<env name="KERNEL_CLASS" value="\Symfony\Cmf\Bundle\RoutingBundle\Tests\Fixtures\App\Kernel"/>
</php>
</phpunit>
9 changes: 2 additions & 7 deletions src/Doctrine/Orm/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
* {@inheritdoc}
*
* Provides a redirect route stored in the Doctrine ORM and used as content for generic route to provide redirects
*
* @property int $id
*/
class RedirectRoute extends RedirectRouteModel
{
/**
* Unique id of this route.
*
* @var int
*/
protected $id;

protected string $serialisedParameters;

/**
Expand Down
8 changes: 2 additions & 6 deletions tests/Functional/Doctrine/Orm/RedirectRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@

class RedirectRouteTest extends OrmTestCase
{
private $repository;

private $controller;
private RedirectController $controller;

public function setUp(): void
{
parent::setUp();
$this->clearDb(Route::class);
$this->clearDb(RedirectRoute::class);

$this->repository = $this->getContainer()->get('cmf_routing.route_provider');
$this->controller = new RedirectController($this->getContainer()->get('router'));
}

public function testRedirectDoctrine()
public function testRedirectDoctrine(): void
{
$route = $this->createRoute('route1', '/test');

Expand All @@ -52,7 +49,6 @@ public function testRedirectDoctrine()

$response = $this->controller->redirectAction($redirectRoute->getContent());

$this->assertInstanceOf(RedirectResponse::class, $response);
$this->assertSame(301, $response->getStatusCode());
$this->assertSame('http://localhost/test', $response->getTargetUrl());
}
Expand Down

0 comments on commit 54bfbe4

Please sign in to comment.