Skip to content

Commit

Permalink
Fix compatibility with Symfony 4 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
damienalexandre authored and pyrech committed Dec 28, 2017
1 parent 4560163 commit a1a43a9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/Bridge/Symfony/DataCollector/SeoOverrideDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
1 change: 1 addition & 0 deletions src/Bridge/Symfony/Resources/config/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/Fixtures/symfony/app/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
app.controller:
class: Joli\SeoOverride\Tests\Functional\Fixtures\symfony\src\Controller\AppController
public: true
calls:
- [setContainer, ["@service_container"]]

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/SymfonyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a1a43a9

Please sign in to comment.