Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- '8.3'
symfony-version:
- '6.4.*'
- '7.2.*'
- '7.3.*'
dependency-versions: ['highest']
include:
# testing lowest PHP+dependencies with lowest Symfony
Expand Down
2 changes: 1 addition & 1 deletion src/Security/UserClassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function addUserInterfaceImplementation(ClassSourceManipulator $manipulat

$this->addPasswordImplementation($manipulator, $userClassConfig);

if (class_exists(IsGrantedContext::class)) {
if (class_exists(IsGrantedContext::class) && $userClassConfig->hasPassword()) {
$this->addSerialize($manipulator);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Test/MakerTestEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private function buildFlexSkeleton(): void
$flexProjectDir = \sprintf('flex_project%s', $targetVersion);

MakerTestProcess::create(
\sprintf('composer create-project symfony/skeleton%s %s --prefer-dist --no-progress', $versionString, $flexProjectDir),
\sprintf('composer create-project symfony/skeleton%s %s --prefer-dist --no-progress --keep-vcs', $versionString, $flexProjectDir),
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure when this broke but we need the .git directory as the created project serves as the base repository for the following tests

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, it relied on Flex running git init to create a new git repository (free from the history of the skeleton)

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, that might indeed explain it

Copy link

@nxtpge nxtpge Nov 19, 2025

Choose a reason for hiding this comment

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

Thank you @xabbuh, this change solved the problem I faced while trying to run the repository tests.

Now, I can complete my feature.

$this->cachePath
)->run();

Expand All @@ -260,7 +260,7 @@ private function buildFlexSkeleton(): void
}

// fetch a few packages needed for testing
MakerTestProcess::create('composer require phpunit browser-kit symfony/css-selector --prefer-dist --no-progress --no-suggest', $this->flexPath)
MakerTestProcess::create('composer require phpunit:1.1.* browser-kit symfony/css-selector --prefer-dist --no-progress --no-suggest', $this->flexPath)
Copy link
Member Author

Choose a reason for hiding this comment

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

symfony/test-pack 1.2 brings us PHPUnit 12 which the tests don't run with

Copy link
Member

Choose a reason for hiding this comment

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

1.1.* is weird. Don't you mean 11.* instead ?

Copy link
Member Author

Choose a reason for hiding this comment

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

->run();

if ('\\' !== \DIRECTORY_SEPARATOR) {
Expand Down
11 changes: 0 additions & 11 deletions tests/Security/fixtures/expected/UserEntityWithoutPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@ public function setRoles(array $roles): static
return $this;
}

/**
* Ensure the session doesn't contain actual password hashes by CRC32C-hashing them, as supported since Symfony 7.3.
*/
public function __serialize(): array
{
$data = (array) $this;
$data["\0" . self::class . "\0password"] = hash('crc32c', $this->password);

return $data;
}

#[\Deprecated]
public function eraseCredentials(): void
{
Expand Down
11 changes: 0 additions & 11 deletions tests/Security/fixtures/expected/UserModelWithoutPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ public function setRoles(array $roles): static
return $this;
}

/**
* Ensure the session doesn't contain actual password hashes by CRC32C-hashing them, as supported since Symfony 7.3.
*/
public function __serialize(): array
{
$data = (array) $this;
$data["\0" . self::class . "\0password"] = hash('crc32c', $this->password);

return $data;
}

#[\Deprecated]
public function eraseCredentials(): void
{
Expand Down