Skip to content
Open
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 api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"justinrainbow/json-schema": "6.7.2",
"php-coveralls/php-coveralls": "2.9.1",
"phpstan/phpstan": "2.1.40",
"phpunit/phpunit": "12.5.14",
"phpunit/phpunit": "13.0.5",
"rector/rector": "2.3.8",
"psalm/phar": "6.16.1",
"spatie/phpunit-snapshot-assertions": "5.3.2",
Expand Down
504 changes: 306 additions & 198 deletions api/composer.lock

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions api/tests/Api/ResetPassword/UpdatePasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,10 @@ public function testPatchResetPasswordActivatesUser() {

protected function mockRecaptcha($shouldReturnSuccess = true) {
$container = static::getContainer();
$recaptcha = $this->createMock(ReCaptchaWrapper::class);
$response = $this->createMock(Response::class);
$recaptcha->expects(self::any())
->method('verify')
->willReturn($response)
;
$response->expects(self::any())
->method('isSuccess')
->willReturn($shouldReturnSuccess)
;
$recaptcha = $this->createStub(ReCaptchaWrapper::class);
$response = $this->createStub(Response::class);
$recaptcha->method('verify')->willReturn($response);
$response->method('isSuccess')->willReturn($shouldReturnSuccess);
$container->set(ReCaptchaWrapper::class, $recaptcha);
}
}
5 changes: 3 additions & 2 deletions api/tests/Doctrine/Filter/ExpressionDateTimeFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public function setUp(): void {
;
$this->queryBuilderMock
->method('getDQLPart')
->with('join')
->willReturn([])
->willReturnCallback(function ($part) {
return 'join' === $part ? [] : null;
})
;

$this->queryNameGeneratorInterfaceMock
Expand Down
2 changes: 1 addition & 1 deletion api/tests/State/CampCollaborationCreateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function setUp(): void {

$decoratedProcessor = $this->createStub(ProcessorInterface::class);
$this->security = $this->createMock(Security::class);
$this->security->expects(self::any())->method('getUser')->willReturn($this->user);
$this->security->method('getUser')->willReturn($this->user);
$pwHashFactory = $this->createStub(PasswordHasherFactory::class);
$this->profileRepository = $this->createMock(ProfileRepository::class);
$this->em = $this->createMock(EntityManagerInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion api/tests/State/CampCollaborationUpdateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function setUp(): void {

$decoratedProcessor = $this->createStub(ProcessorInterface::class);
$security = $this->createMock(Security::class);
$security->expects(self::any())->method('getUser')->willReturn($this->user);
$security->method('getUser')->willReturn($this->user);
$pwHashFactory = $this->createStub(PasswordHasherFactory::class);
$this->mailService = $this->createMock(MailService::class);

Expand Down
5 changes: 1 addition & 4 deletions api/tests/State/ProfileUpdateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ protected function setUp(): void {
$this->mailService = $this->createMock(MailService::class);
$decoratedProcessor = $this->createStub(ProcessorInterface::class);

$pwHasherFactory->expects(self::any())
->method('getPasswordHasher')
->willReturn($this->pwHasher)
;
$pwHasherFactory->method('getPasswordHasher')->willReturn($this->pwHasher);

$this->processor = new ProfileUpdateProcessor(
$decoratedProcessor,
Expand Down
5 changes: 1 addition & 4 deletions api/tests/State/ResendActivationProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ protected function setUp(): void {
$this->userRepository = $this->createMock(UserRepository::class);
$this->mailService = $this->createMock(MailService::class);

$recaptcha->expects(self::any())
->method('verify')
->willReturn($this->recaptchaResponse)
;
$recaptcha->method('verify')->willReturn($this->recaptchaResponse);

$this->processor = new ResendActivationProcessor(
$recaptcha,
Expand Down
11 changes: 2 additions & 9 deletions api/tests/State/ResetPasswordCreateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,8 @@ protected function setUp(): void {
$this->pwHasher = $this->createMock(PasswordHasherInterface::class);
$this->mailService = $this->createMock(MailService::class);

$recaptcha->expects(self::any())
->method('verify')
->willReturn($this->recaptchaResponse)
;

$pwHasherFactory->expects(self::any())
->method('getPasswordHasher')
->willReturn($this->pwHasher)
;
$recaptcha->method('verify')->willReturn($this->recaptchaResponse);
$pwHasherFactory->method('getPasswordHasher')->willReturn($this->pwHasher);

$this->processor = new ResetPasswordCreateProcessor(
$recaptcha,
Expand Down
11 changes: 2 additions & 9 deletions api/tests/State/ResetPasswordUpdateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,8 @@ protected function setUp(): void {
$pwHasherFactory = $this->createMock(PasswordHasherFactory::class);
$this->pwHasher = $this->createMock(PasswordHasherInterface::class);

$recaptcha->expects(self::any())
->method('verify')
->willReturn($this->recaptchaResponse)
;

$pwHasherFactory->expects(self::any())
->method('getPasswordHasher')
->willReturn($this->pwHasher)
;
$recaptcha->method('verify')->willReturn($this->recaptchaResponse);
$pwHasherFactory->method('getPasswordHasher')->willReturn($this->pwHasher);

$this->processor = new ResetPasswordUpdateProcessor(
$recaptcha,
Expand Down
5 changes: 1 addition & 4 deletions api/tests/State/UserCreateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ protected function setUp(): void {

$this->recaptchaResponse = $this->createMock(Response::class);
$recaptcha = $this->createMock(ReCaptchaWrapper::class);
$recaptcha->expects(self::any())
->method('verify')
->willReturn($this->recaptchaResponse)
;
$recaptcha->method('verify')->willReturn($this->recaptchaResponse);

$this->userPasswordHasher = $this->createMock(UserPasswordHasher::class);
$this->mailService = $this->createMock(MailService::class);
Expand Down
Loading