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

Removed deprecated twig tags #40

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

basdenooijer
Copy link

@basdenooijer basdenooijer commented Sep 11, 2024

  • Removed use of deprecated spaceless filter
  • Fixes indentation for the template code that was wrapped by these filters

Related to #39

@mhujer
Copy link
Owner

mhujer commented Sep 15, 2024

@basdenooijer Hello, thanks for the PR!

Can you please also adjust the tests in https://github.com/mhujer/BreadcrumbsBundle/blob/master/Test/BundleTest.php? You can run them locally with vendor/bin/phpunit. I think it would make sense to use nowdoc for the expected output.

@basdenooijer
Copy link
Author

Sure, I was a bit in rush with the fix so completely missed the tests. Just pushed an update.

Shortly looked into comparing the HTML independent of the whitespace in the template, but there doesn't seem to be an easy way to do this. Introducing a (dev) dependency just for this seemed overkill.

@@ -72,8 +90,23 @@ public function testRenderingTranslationWithParametersAndTranslationDomain()
/** @var \WhiteOctober\BreadcrumbsBundle\Twig\Extension\BreadcrumbsExtension $breadcrumbsExtension */
$breadcrumbsExtension = $container->get('white_october_breadcrumbs.twig');

self::assertSame(
'<ol id="wo-breadcrumbs" class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">foo__domain:admin</span><meta itemprop="position" content="1" /><span class=\'separator\'>/</span></li><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">bar__{name:John}__domain:admin</span><meta itemprop="position" content="2" /></li></ol>',
self::assertStringEqualsStringIgnoringLineEndings(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, I didn't know that this one existed! 👍

@mhujer mhujer merged commit a2cde1f into mhujer:master Sep 16, 2024
12 checks passed
@mhujer
Copy link
Owner

mhujer commented Sep 16, 2024

@basdenooijer Thank you! Merged and tagged as 1.5.10

@basdenooijer
Copy link
Author

Great 👍

@basdenooijer basdenooijer deleted the fix-twig-deprecations branch September 16, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants