|
|
@@ -2213,8 +2213,11 @@ class OrganizationFactoryTest extends TestCase
|
|
|
// Set up the AccessRepository to return the access when findAdminAccess is called
|
|
|
$this->accessRepository->method('findAdminAccess')->with($organization)->willReturn($access);
|
|
|
|
|
|
- // Expect the person's setPassword method to be called with the password
|
|
|
- $person->expects(self::once())->method('setPassword')->with('Password123!');
|
|
|
+ // Expect the person's setPassword method to be called with a hashed password (not the plain password)
|
|
|
+ $person->expects(self::once())->method('setPassword')->with(self::callback(function($hashedPassword) {
|
|
|
+ // Verify that the password is not the plain text password
|
|
|
+ return is_string($hashedPassword) && $hashedPassword !== 'Password123!';
|
|
|
+ }));
|
|
|
|
|
|
// Expect the EntityManager's persist and flush methods to be called
|
|
|
$this->entityManager->expects(self::once())->method('persist')->with($person);
|