luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
811 stars 205 forks source link

Added new option `Composer::$hideDefaultPrefixOnly` #1834

Closed Webkadabra closed 6 years ago

Webkadabra commented 6 years ago

What are you changing/introducing

Added new option Composer::$hideDefaultPrefixOnly When enabled, composition prefixes will be hidden only for default language. Takes effect only when hidden option is disabled.

What is the reason for changing/introducing

Some websites treat root as default language, and use prefixes for secondary languages, for example:

company.com/about company.com/fr/about

I'm sorry I don't code tests, hopefully somebody can help.

QA

Q A
Is bugfix? no
New feature? yes
Breaks BC? no
Tests pass? n/a
Fixed issues
coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.4%) to 55.647% when pulling b2c9cef83180c2f6ea0ebe02090df8759018be01 on Webkadabra:master into 0dcaa10abce2834e735b7aada20095cad6e1e79c on luyadev:master.

Webkadabra commented 6 years ago

Guys I'm really sorry I can write a test, if somebody could help that'd be super nice.

nadar commented 6 years ago

@Webkadabra just add your assertion tests for this new property here: https://github.com/luyadev/luya/blob/master/tests/core/web/CompositionTest.php

and run ./vendor/bin/phpunit tests/core/web/CompositionTest and see if your test works.

This tests shows very clear how to configure a given scenario you might to test: https://github.com/luyadev/luya/blob/master/tests/core/web/CompositionTest.php#L273-L296

Webkadabra commented 6 years ago

@nadar I've PHP 5.6.25 (need PHP 7 for luya-testsuite) and really never wrote tests for PHP

nadar commented 6 years ago

We need a unit test for the core library, this will break to much stuff if does not work as expected. Maybe i have some time.

I encourage you to update your cli env - you will have to do it sooner or later anyway ;-)

Webkadabra commented 6 years ago

@nadar I'm just not really working as a developer at all, I only support/work on one project that's not making any money, and it's on production and it's got PHP 5.6 on server. I will definitely update some time