Skip to content
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

Merge release 2.7.0 into 3.0.x #858

Merged
merged 21 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac" # v4
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4

- name: "Using Node"
uses: "actions/setup-node@v3.8.1"
uses: "actions/setup-node@v4.0.2"

- name: "Install dependencies"
run: "yarn"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ jobs:
with:
PHP_EXTENSIONS: "mbstring"
SYMFONY_KERNEL: "Nucleos\\GDPRBundle\\Tests\\App\\AppKernel"
SYMFONY_VERSIONS: "6.4,7.0"
secrets:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.7.0 - TBD
## 3.0.0 - TBD

### Added

Expand All @@ -24,6 +24,40 @@ All notable changes to this project will be documented in this file, in reverse

- Nothing.

## 2.7.0 - 2024-03-25


-----

### Release Notes for [2.7.0](https://github.com/nucleos/NucleosGDPRBundle/milestone/12)

Feature release (minor)

### 2.7.0

- Total issues resolved: **0**
- Total pull requests resolved: **10**
- Total contributors: **3**

#### dependency

- [857: Bump webpack-dev-middleware from 5.3.3 to 5.3.4](https://github.com/nucleos/NucleosGDPRBundle/pull/857) thanks to @dependabot[bot]
- [856: Bump follow-redirects from 1.15.4 to 1.15.6](https://github.com/nucleos/NucleosGDPRBundle/pull/856) thanks to @dependabot[bot]
- [855: Update dependency psalm/plugin-phpunit to ^0.19](https://github.com/nucleos/NucleosGDPRBundle/pull/855) thanks to @renovate[bot]
- [850: Bump to symfony ^6.4 || ^7.0](https://github.com/nucleos/NucleosGDPRBundle/pull/850) thanks to @core23
- [847: Update dependency symfony/phpunit-bridge to v7](https://github.com/nucleos/NucleosGDPRBundle/pull/847) thanks to @renovate[bot]
- [846: Update dependency matthiasnoback/symfony-dependency-injection-test to v5](https://github.com/nucleos/NucleosGDPRBundle/pull/846) thanks to @renovate[bot]

#### dependency,javascript

- [851: Bump follow-redirects from 1.14.8 to 1.15.4](https://github.com/nucleos/NucleosGDPRBundle/pull/851) thanks to @dependabot[bot]
- [836: Bump @babel/traverse from 7.21.2 to 7.23.2](https://github.com/nucleos/NucleosGDPRBundle/pull/836) thanks to @dependabot[bot]
- [835: Bump postcss from 8.4.14 to 8.4.31](https://github.com/nucleos/NucleosGDPRBundle/pull/835) thanks to @dependabot[bot]

#### Enhancement

- [848: Update tools ](https://github.com/nucleos/NucleosGDPRBundle/pull/848) thanks to @core23

## 2.6.0 - 2023-07-20


Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@
"php": "^8.1",
"sonata-project/block-bundle": "^4.21 || ^5.0",
"sonata-project/form-extensions": "^1.19 || ^2.0",
"symfony/dependency-injection": "^5.4 || ^6.2",
"symfony/event-dispatcher": "^5.4 || ^6.2",
"symfony/expression-language": "^5.4 || ^6.2",
"symfony/framework-bundle": "^5.4.19 || ^6.2.5",
"symfony/http-foundation": "^5.4 || ^6.2",
"symfony/http-kernel": "^5.4 || ^6.2",
"symfony/options-resolver": "^5.4 || ^6.2",
"symfony/twig-bundle": "^5.4 || ^6.2"
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/options-resolver": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.0.1",
"symfony/browser-kit": "^5.4 || ^6.2",
"symfony/console": "^5.4 || ^6.2",
"symfony/yaml": "^5.4 || ^6.2"
"symfony/browser-kit": "^6.4 || ^7.0",
"symfony/console": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0"
},
"suggest": {
"nucleos/shariff-bundle": "If you need a GDPR conform social media widget integration"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"eslint-plugin-import": "^2.27.5",
"eslint-watch": "^8.0.0",
"sass": "^1.57.1",
"sass-loader": "^13.2.0",
"sass-loader": "^14.0.0",
"size-limit": "^9.0.0",
"webpack": "^5.72",
"webpack-cli": "^5.0.0"
Expand Down
13 changes: 7 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage/>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
</php>
Expand All @@ -13,4 +9,9 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.14.2@3538fe1955d47f6ee926c0769d71af6db08aa488"/>
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591"/>
4 changes: 1 addition & 3 deletions src/Block/Service/GDPRInformationBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

return $this
->renderResponse($blockContext->getTemplate(), $parameters, $response)
->setTtl(0)

Check warning on line 60 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ return new Response('', Response::HTTP_NO_CONTENT); } $parameters = ['context' => $blockContext, 'settings' => $blockContext->getSettings(), 'block' => $blockContext->getBlock()]; - return $this->renderResponse($blockContext->getTemplate(), $parameters, $response)->setTtl(0)->setPrivate(); + return $this->renderResponse($blockContext->getTemplate(), $parameters, $response)->setTtl(-1)->setPrivate(); } public function configureCreateForm(FormMapper $form, BlockInterface $block): void {

Check warning on line 60 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ return new Response('', Response::HTTP_NO_CONTENT); } $parameters = ['context' => $blockContext, 'settings' => $blockContext->getSettings(), 'block' => $blockContext->getBlock()]; - return $this->renderResponse($blockContext->getTemplate(), $parameters, $response)->setTtl(0)->setPrivate(); + return $this->renderResponse($blockContext->getTemplate(), $parameters, $response)->setTtl(1)->setPrivate(); } public function configureCreateForm(FormMapper $form, BlockInterface $block): void {
->setPrivate()
;
}
Expand All @@ -69,15 +69,15 @@

public function configureEditForm(FormMapper $form, BlockInterface $block): void
{
$form->add('settings', ImmutableArrayType::class, [

Check warning on line 72 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {
'keys' => [

Check warning on line 73 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['keys' => [['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {
['text', TextType::class, [

Check warning on line 74 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {

Check warning on line 74 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['keys' => [[TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {
'label' => 'form.label_text',
'required' => false,

Check warning on line 76 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => true]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {
]],
['url', UrlType::class, [

Check warning on line 78 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {

Check warning on line 78 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], [UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {
'label' => 'form.label_url',
'required' => false,

Check warning on line 80 in src/Block/Service/GDPRInformationBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ } public function configureEditForm(FormMapper $form, BlockInterface $block): void { - $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => false]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); + $form->add('settings', ImmutableArrayType::class, ['keys' => [['text', TextType::class, ['label' => 'form.label_text', 'required' => false]], ['url', UrlType::class, ['label' => 'form.label_url', 'required' => true]], ['position', ChoiceType::class, ['label' => 'form.label_position', 'choices' => ['form.choice_top' => 'top', 'form.choice_fixedtop' => 'fixedtop', 'form.choice_bottom' => 'bottom', 'form.choice_block' => 'block']]]], 'translation_domain' => 'NucleosGDPRBundle']); } public function configureSettings(OptionsResolver $resolver): void {
]],
['position', ChoiceType::class, [
'label' => 'form.label_position',
Expand All @@ -103,9 +103,7 @@
]);
}

public function validate(ErrorElement $errorElement, BlockInterface $block): void
{
}
public function validate(ErrorElement $errorElement, BlockInterface $block): void {}

Check warning on line 106 in src/Block/Service/GDPRInformationBlockService.php

View check run for this annotation

Codecov / codecov/patch

src/Block/Service/GDPRInformationBlockService.php#L106

Added line #L106 was not covered by tests

public function getMetadata(): MetadataInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/NucleosGDPRBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

final class NucleosGDPRBundle extends Bundle
{
}
final class NucleosGDPRBundle extends Bundle {}
1 change: 0 additions & 1 deletion src/Resources/config/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@
new Reference('twig'),
new Reference('request_stack'),
])

;
};
1 change: 0 additions & 1 deletion src/Resources/config/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@
null,
false,
])

;
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public function testRender(): void

$client->request('GET', '/twig-test');

static::assertSame(200, $client->getResponse()->getStatusCode());
self::assertSame(200, $client->getResponse()->getStatusCode());
}
}
18 changes: 9 additions & 9 deletions tests/Block/Service/GDPRInformationBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testExecute(): void

$response = new Response();

$this->twig->expects(static::once())->method('render')
$this->twig->expects(self::once())->method('render')
->with(
'@NucleosGDPR/Block/block_gdpr.html.twig',
[
Expand All @@ -84,8 +84,8 @@ public function testExecute(): void

$blockService = new GDPRInformationBlockService($this->twig, $this->requestStack);

static::assertSame($response, $blockService->execute($blockContext, $response));
static::assertSame('TWIG_CONTENT', $response->getContent());
self::assertSame($response, $blockService->execute($blockContext, $response));
self::assertSame('TWIG_CONTENT', $response->getContent());
}

public function testExecuteWithExistingCookie(): void
Expand All @@ -104,7 +104,7 @@ public function testExecuteWithExistingCookie(): void
$blockService = new GDPRInformationBlockService($this->twig, $this->requestStack);
$response = $blockService->execute($blockContext);

static::assertTrue($response->isEmpty());
self::assertTrue($response->isEmpty());
}

public function testGetMetadata(): void
Expand All @@ -113,10 +113,10 @@ public function testGetMetadata(): void

$metadata = $blockService->getMetadata();

static::assertSame('nucleos_gdpr.block.information', $metadata->getTitle());
static::assertNull($metadata->getImage());
static::assertSame('NucleosGDPRBundle', $metadata->getDomain());
static::assertSame([
self::assertSame('nucleos_gdpr.block.information', $metadata->getTitle());
self::assertNull($metadata->getImage());
self::assertSame('NucleosGDPRBundle', $metadata->getDomain());
self::assertSame([
'class' => 'fa fa-balance-scale',
], $metadata->getOptions());
}
Expand All @@ -128,7 +128,7 @@ public function testConfigureEditForm(): void
$block = new Block();

$formMapper = $this->createMock(FormMapper::class);
$formMapper->expects(static::once())->method('add');
$formMapper->expects(self::once())->method('add');

$blockService->configureEditForm($formMapper, $block);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testDefaultOptions(): void
$expected = [
];

static::assertSame($expected, $config);
self::assertSame($expected, $config);
}

public function testBlockedCookieEnabled(): void
Expand All @@ -43,7 +43,7 @@ public function testBlockedCookieEnabled(): void
],
];

static::assertSame($expected, $config);
self::assertSame($expected, $config);
}

public function testBlockedCookieOptions(): void
Expand All @@ -62,6 +62,6 @@ public function testBlockedCookieOptions(): void
],
];

static::assertSame($expected, $config);
self::assertSame($expected, $config);
}
}
20 changes: 10 additions & 10 deletions tests/EventListener/KernelEventSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ public function testCleanCookiesWithDisabledOption(): void
$response->headers->setCookie(Cookie::create(GDPRInformationBlockService::COOKIE_NAME));

$event = new ResponseEvent(
$this->createStub(HttpKernelInterface::class),
$this->createStub(Request::class),
self::createStub(HttpKernelInterface::class),
self::createStub(Request::class),
0,
$response
);

$subscriber = new KernelEventSubscriber(null);
$subscriber->cleanCookies($event);

static::assertCount(4, $response->headers->getCookies());
self::assertCount(4, $response->headers->getCookies());
$this->assertHasCookie(self::SOME_COOKIE_NAME, $response);
$this->assertHasCookie(self::KEEP_COOKIE_NAME, $response);
$this->assertHasCookie(self::KEEP_REGED_EXAMPLE, $response);
Expand All @@ -61,8 +61,8 @@ public function testCleanCookiesWithConsent(): void
$response->headers->setCookie(Cookie::create(GDPRInformationBlockService::COOKIE_NAME));

$event = new ResponseEvent(
$this->createStub(HttpKernelInterface::class),
$this->createStub(Request::class),
self::createStub(HttpKernelInterface::class),
self::createStub(Request::class),
0,
$response
);
Expand All @@ -73,7 +73,7 @@ public function testCleanCookiesWithConsent(): void
]);
$subscriber->cleanCookies($event);

static::assertCount(4, $response->headers->getCookies());
self::assertCount(4, $response->headers->getCookies());
$this->assertHasCookie(self::SOME_COOKIE_NAME, $response);
$this->assertHasCookie(self::KEEP_COOKIE_NAME, $response);
$this->assertHasCookie(self::KEEP_REGED_EXAMPLE, $response);
Expand All @@ -88,8 +88,8 @@ public function testCleanCookiesWithNoConsent(): void
$response->headers->setCookie(Cookie::create(self::KEEP_REGED_EXAMPLE));

$event = new ResponseEvent(
$this->createStub(HttpKernelInterface::class),
$this->createStub(Request::class),
self::createStub(HttpKernelInterface::class),
self::createStub(Request::class),
0,
$response
);
Expand All @@ -100,14 +100,14 @@ public function testCleanCookiesWithNoConsent(): void
]);
$subscriber->cleanCookies($event);

static::assertCount(2, $response->headers->getCookies());
self::assertCount(2, $response->headers->getCookies());
$this->assertHasCookie(self::KEEP_COOKIE_NAME, $response);
$this->assertHasCookie(self::KEEP_REGED_EXAMPLE, $response);
}

private function assertHasCookie(string $cookieName, Response $response): void
{
static::assertCount(1, array_filter($response->headers->getCookies(), static function (Cookie $cookie) use ($cookieName): bool {
self::assertCount(1, array_filter($response->headers->getCookies(), static function (Cookie $cookie) use ($cookieName): bool {
return $cookie->getName() === $cookieName;
}));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/NucleosGDPRBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function testGetContainerExtension(): void
{
$bundle = new NucleosGDPRBundle();

static::assertInstanceOf(NucleosGDPRExtension::class, $bundle->getContainerExtension());
self::assertInstanceOf(NucleosGDPRExtension::class, $bundle->getContainerExtension());
}
}
11 changes: 8 additions & 3 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.3",
"maglnet/composer-require-checker": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
"matthiasnoback/symfony-dependency-injection-test": "^5.0",
"phpmd/phpmd": "^2.10",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.0",
Expand All @@ -14,15 +14,20 @@
"phpstan/phpstan-strict-rules": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^10.0",
"psalm/plugin-phpunit": "^0.18",
"psalm/plugin-phpunit": "^0.19",
"psalm/plugin-symfony": "^5.0",
"symfony/phpunit-bridge": "^6.0",
"symfony/phpunit-bridge": "^7.0",
"vimeo/psalm": "^5.0"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
},
"bin-dir": "../../vendor/bin"
},
"extra": {
"symfony": {
"require": "6.4.*"
}
}
}
Loading
Loading