Skip to content

Commit 13f5c56

Browse files
rvanlaakNyholm
authored andcommitted
Switch activator comparison result (#103)
* Switch activator comparison result * Fix tests * cs * cs * Update Changelog.md
1 parent 7cda3cf commit 13f5c56

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 0.3.5
6+
7+
### Fixed
8+
9+
- Fix incorrect EditInPlace activation on Twig `is_safe` comparison
10+
511
## 0.3.4
612

713
### Fixed

Tests/Functional/EditInPlaceTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@
1818
*/
1919
class EditInPlaceTest extends BaseTestCase
2020
{
21-
public function testDeactivatedTest()
22-
{
23-
$this->bootKernel();
24-
$request = Request::create('/foobar');
25-
$response = $this->kernel->handle($request);
26-
27-
self::assertSame(200, $response->getStatusCode());
28-
self::assertNotContains('x-trans', $response->getContent());
29-
}
30-
3121
public function testActivatedTest()
3222
{
3323
$this->bootKernel();
@@ -90,4 +80,14 @@ public function testIfUntranslatableLabelGetsDisabled()
9080
$attributeDiv = $dom->getElementById('attribute-div');
9181
self::assertEquals('translated.attribute', $attributeDiv->getAttribute('data-value'));
9282
}
83+
84+
public function testDeactivatedTest()
85+
{
86+
$this->bootKernel();
87+
$request = Request::create('/foobar');
88+
$response = $this->kernel->handle($request);
89+
90+
self::assertSame(200, $response->getStatusCode());
91+
self::assertNotContains('x-trans', $response->getContent());
92+
}
9393
}

Twig/TranslationExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getFilters()
5050
*/
5151
public function isSafe($node)
5252
{
53-
return $this->activator->checkRequest($this->requestStack->getMasterRequest()) ? [] : ['html'];
53+
return $this->activator->checkRequest($this->requestStack->getMasterRequest()) ? ['html'] : [];
5454
}
5555

5656
/**

0 commit comments

Comments
 (0)