You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm reaching out to address an issue I've encountered while conducting unit tests following an upgrade to S7. Previously, in S6.4, I was able to successfully execute a request to an endpoint from the setup method in my unit tests using the Crawler client. However, after upgrading to S7, I've noticed a discrepancy in the behavior.
Previously, upon making a request in the setup method and setting a breakpoint in the controller, the controller would be called as expected. However, under the updated version (S7), the controller does not seem to be triggered when making a request in the setup function. Even after setting a breakpoint in the controller, the unit test continues to the next step without invoking the controller. Consequently, while the unit test proceeds without any errors, the controller remains untouched.
This inconsistency has posed a challenge in conducting accurate unit tests and ensuring the functionality of the controller is properly validated. I believe this issue warrants attention to ensure the reliability and effectiveness of our unit testing process.
How to reproduce
protectedfunctionsetUp(): void
{
parent::setUp();
$this->authHEader = [
'HTTP_AUTHORIZATION' => "Bearer 123456",
];
$this->client = static::createClient();
$manager = self::getContainer()->get(EntityManagerInterface::class);
$userRepo = self::getContainer()->get(UserRepository::class);
$roomRepo = self::getContainer()->get(RoomsRepository::class);
$this->room = $roomRepo->findOneBy(['name' => 'This is a room with Lobby']);
$user = $userRepo->findOneBy(['email' => 'ldapUser@local.de']);
$callerUserId = newCallerId();
$callerUserId->setCreatedAt(new \DateTime())
->setRoom($this->room)
->setUser($user)
->setCallerId('987654321');
$manager->persist($callerUserId);
$manager->flush();
$this->client->loginUser($this->room->getModerator());
$invite = $userRepo->findOneBy(['email' => 'ldapUser@local.de']);
//here is the line where I want to make an request$crawler = $this->client->request('POST', '/room/callout/invite/' . $this->room->getUidReal(), ['uid' => $invite->getEmail()]);
$calloutRepo = self::getContainer()->get(CalloutSessionRepository::class);
$this->calloutSession = $calloutRepo->findOneBy(['room' => $this->room, 'user' => $invite]);
}
This discussion was converted from issue #54717 on April 24, 2024 11:38.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Symfony version(s) affected
7.0.3
Description
I'm reaching out to address an issue I've encountered while conducting unit tests following an upgrade to S7. Previously, in S6.4, I was able to successfully execute a request to an endpoint from the setup method in my unit tests using the Crawler client. However, after upgrading to S7, I've noticed a discrepancy in the behavior.
Previously, upon making a request in the setup method and setting a breakpoint in the controller, the controller would be called as expected. However, under the updated version (S7), the controller does not seem to be triggered when making a request in the setup function. Even after setting a breakpoint in the controller, the unit test continues to the next step without invoking the controller. Consequently, while the unit test proceeds without any errors, the controller remains untouched.
This inconsistency has posed a challenge in conducting accurate unit tests and ensuring the functionality of the controller is properly validated. I believe this issue warrants attention to ensure the reliability and effectiveness of our unit testing process.
How to reproduce
callout Controller
Possible Solution
No response
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions