Skip to content

[Routing] apply deprecation triggers and fix tests #13361

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

Merged
merged 3 commits into from
Jan 13, 2015

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented Jan 11, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets [#12641, #12640, #12719]
License MIT
Doc PR

Correctly add deprecation for _scheme and _method requirements and fix code to not trigger deprecations itself. And fix test so that they either explicitly test deprecated functionality or alternatively refactor tests to use new style.

It also fixes the deprecation triggers for "pattern" which was not correctly done for YAML/XML loading.

@@ -118,7 +118,6 @@ public function testDumpForRouteWithDefaults()
public function testDumpWithSchemeRequirement()
{
$this->routeCollection->add('Test1', new Route('/testing', array(), array(), array(), '', array('ftp', 'https')));
$this->routeCollection->add('Test2', new Route('/testing_bc', array(), array('_scheme' => 'https'))); // BC
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of these tests are useless because we already tested that logic inside the Route class that _scheme/_methods is backwards compatible and will result in the same route representation.

@Tobion
Copy link
Contributor Author

Tobion commented Jan 11, 2015

Ready

@Tobion
Copy link
Contributor Author

Tobion commented Jan 11, 2015

@fabpot please also merge to master, so I can make a PR to remove the deprecated stuff.

@@ -38,26 +38,6 @@ public function testRedirectWhenNoSlash()
);
}

public function testSchemeRedirectBC()
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to prefix the test method's name with testLegacy instead of removing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, the test doesnt provide any value as I explained above

@stof
Copy link
Member

stof commented Jan 12, 2015

@Tobion there seems to be some remaining ones in the FrameworkBundle functional tests: https://travis-ci.org/symfony/symfony/jobs/46636638#L1759

@Tobion
Copy link
Contributor Author

Tobion commented Jan 12, 2015

@stof Yes the reason for this was hard to spot. But I found it and fixed it in a BC way. The problem was the container parameter resolving in the framework router that still accessed the deprecated requirements.

@fabpot
Copy link
Member

fabpot commented Jan 12, 2015

👍

@stof
Copy link
Member

stof commented Jan 13, 2015

I still think that my suggestion in #13361 (comment) is legitimate. What do you think @fabpot ?

@Tobion Tobion force-pushed the routing-deprecation-trigger branch from 92e7fa1 to 9af0ff2 Compare January 13, 2015 12:23
@Tobion Tobion merged commit 9af0ff2 into symfony:2.7 Jan 13, 2015
Tobion added a commit that referenced this pull request Jan 13, 2015
…bion)

This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] apply deprecation triggers and fix tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | [#12641, #12640, #12719]
| License       | MIT
| Doc PR        |

Correctly add deprecation for _scheme and _method requirements and fix code to not trigger deprecations itself. And fix test so that they either explicitly test deprecated functionality or alternatively refactor tests to use new style.

It also fixes the deprecation triggers for "pattern" which was not correctly done for YAML/XML loading.

Commits
-------

9af0ff2 [FrameworkBundle] fix routing container param resolving to not access deprecated requirements while maintaining BC
bd91867 [FrameworkBundle] remove superfluous test that is already covered in routing
bc1c5c8 [Routing] apply deprecation triggers and fix tests
@Tobion Tobion deleted the routing-deprecation-trigger branch January 13, 2015 12:46
xabbuh added a commit to xabbuh/symfony that referenced this pull request May 23, 2017
This was initially removed in symfony#13361 and accidentally put back in
xabbuh added a commit to xabbuh/symfony that referenced this pull request May 23, 2017
This was initially removed in symfony#13361 and accidentally added again
in symfony#11394.
fabpot added a commit that referenced this pull request May 24, 2017
This PR was merged into the 3.2 branch.

Discussion
----------

[Routing] remove an unused routing fixture

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This was initially removed in #13361 and accidentally added again
in #11394.

Commits
-------

6f67221 [Routing] remove an unused routing fixture
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.

4 participants