Skip to content

Remove Website and DefaultController action #8073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Jul 28, 2025

Q A
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
Fixed tickets fixes #
Related issues/PRs #7995, #8091
License MIT
Documentation PR sulu/sulu-docs#

What's in this PR?

Remove Website and DefaultController action.

Why?

The content bundle does provide the new website controller for content resolving. All usage of the old DefaultController or WebsiteController should now use the Sulu\Content\UserInterface\Controller\Website\ContentController instead.

@alexander-schranz alexander-schranz added the DX Affecting the end developer label Jul 28, 2025
@alexander-schranz alexander-schranz force-pushed the enhancement/remove-website-and-default-controller branch from 2ec00a7 to 26eb0c6 Compare July 28, 2025 15:26
@alexander-schranz alexander-schranz force-pushed the enhancement/remove-website-and-default-controller branch 7 times, most recently from 288db29 to f314fde Compare August 14, 2025 15:10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Prokyonn added a ToDo for the Segment part here we should readd functional test for it when implemented

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Prokyonn For the none segment part a follow up Pull Request is created: #8091 lets discuss that next week

@alexander-schranz alexander-schranz force-pushed the enhancement/remove-website-and-default-controller branch from 367535e to 668dec0 Compare August 14, 2025 15:28
Comment on lines -40 to -62
public function testPage406ForNotExistFormat(): void
{
$this->client->request('GET', 'http://sulu.lo/.xml');

$response = $this->client->getResponse();
$this->assertHttpStatusCode(406, $response);
}

public function testPageClientAcceptHeaderNotUsed(): void
{
$this->client->request('GET', 'http://sulu.lo/', [], [], [
'HTTP_ACCEPT' => 'text/plain',
]);

$response = $this->client->getResponse();
$this->assertHttpStatusCode(200, $response);

// The accept header need to ignore so the http cache will have the correct content type in it
$this->assertStringStartsWith(
'text/html',
$response->headers->get('Content-Type')
);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied this tests to our ExampleControllerTest maybe in future better move into own ContentControllerTest but better this way as it got not lost.

use Twig\Environment;
use Twig\Loader\FilesystemLoader;

class DefaultControllerTest extends TestCase
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary tests as too much mocks and no new behaviour tests as where functional tested in WebsiteControllerTests and now new functional tests via ExampleControllerTest

@alexander-schranz alexander-schranz force-pushed the enhancement/remove-website-and-default-controller branch from 8cb257c to c572334 Compare August 14, 2025 15:40
use Symfony\Bundle\FrameworkBundle\KernelBrowser;

#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses]
class SecurityListenerTest extends SuluTestCase
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it to our ToDo that we recreate similar tests based on new content storage

@alexander-schranz alexander-schranz merged commit 0858911 into sulu:3.0 Aug 18, 2025
9 checks passed
@alexander-schranz alexander-schranz deleted the enhancement/remove-website-and-default-controller branch August 18, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants