diff --git a/CHANGELOG.md b/CHANGELOG.md index 0878333..4affba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes between versions +## Unreleased + +* Fix Symfony 3.4 / 4.0 compatibility with DataCollector + ## 0.5.0 (2017-10-12) * [BC BREAK] Remove SeoManagerInterface diff --git a/src/Bridge/Symfony/DataCollector/SeoOverrideDataCollector.php b/src/Bridge/Symfony/DataCollector/SeoOverrideDataCollector.php index c4b21b8..ce4e653 100644 --- a/src/Bridge/Symfony/DataCollector/SeoOverrideDataCollector.php +++ b/src/Bridge/Symfony/DataCollector/SeoOverrideDataCollector.php @@ -55,6 +55,14 @@ public function collect(Request $request, Response $response, \Exception $except { } + /** + * {@inheritdoc} + */ + public function reset() + { + $this->data = []; + } + public function getFetchers() { return $this->data['fetchers']; diff --git a/src/Bridge/Symfony/Resources/config/debug.yml b/src/Bridge/Symfony/Resources/config/debug.yml index bde744d..fbc2463 100644 --- a/src/Bridge/Symfony/Resources/config/debug.yml +++ b/src/Bridge/Symfony/Resources/config/debug.yml @@ -9,6 +9,7 @@ services: - '%seo_override.domains%' - ~ - '%seo_override.fetchers_mapping%' + public: true seo_override.data_collector: class: Joli\SeoOverride\Bridge\Symfony\DataCollector\SeoOverrideDataCollector diff --git a/tests/Functional/Fixtures/symfony/app/config/config.yml b/tests/Functional/Fixtures/symfony/app/config/config.yml index 86e4c51..a7b1ec4 100644 --- a/tests/Functional/Fixtures/symfony/app/config/config.yml +++ b/tests/Functional/Fixtures/symfony/app/config/config.yml @@ -1,6 +1,7 @@ services: app.controller: class: Joli\SeoOverride\Tests\Functional\Fixtures\symfony\src\Controller\AppController + public: true calls: - [setContainer, ["@service_container"]] diff --git a/tests/Functional/SymfonyTest.php b/tests/Functional/SymfonyTest.php index 23ec920..0694418 100644 --- a/tests/Functional/SymfonyTest.php +++ b/tests/Functional/SymfonyTest.php @@ -143,7 +143,7 @@ public function test_it_does_not_override_seo_when_no_content_or_binary_response $response = $this->call('/download', 'localhost'); $this->assertSame(200, $response->getStatusCode()); - $this->assertSame(false, $response->getContent()); + $this->assertFalse($response->getContent()); } public function test_it_does_not_override_seo_when_no_2XX_response()