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

Some improvements in tests #4: #13408

Merged
merged 4 commits into from
Dec 30, 2016
Merged

Some improvements in tests #4: #13408

merged 4 commits into from
Dec 30, 2016

Conversation

frankmayer
Copy link
Contributor

@frankmayer frankmayer commented Dec 29, 2016

Summary of Changes

Some improvements in tests 4:

  • removal of some unused variables (and inserted todos if unclear)
  • removal of null assignments on class properties;

Testing Instructions

Code review only.

Documentation Changes Required

None

- removal of some unused variables (and inserted todo's if unclear)
- removal of null assignments on class properties;
*
* @since 12.1
*/
public static function isSupported()
Copy link
Contributor

Choose a reason for hiding this comment

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

All of this classes subclasses inherit this method. It needs to be kept I'm pretty sure?

Copy link
Contributor

Choose a reason for hiding this comment

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

i add that doubt also, but doesn't that came from JCacheStorage class (which this one extends)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wilsonge I noticed that it extends JCacheStorage, which has the identical function. Am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

This one should be fine. It's a mock for JCacheStorage, not a test case being extended.

@@ -1201,6 +1201,8 @@ public function testParseXMLLanguageFile()
'Line: ' . __LINE__
);

//todo: OK to remove this unused assignment and following assertion? Or is some implementation missing?
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove all this. Even if we had the file, assuming it had the correct Spanish data, the test case would fail because the $option array uses English data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my thinking, too, but I wasn't sure if someone would want to expand and correct this test. Will remove.

@@ -44,6 +44,8 @@ public function __construct($options = array())
*/
public function get($id, $group, $checkTime = true)
{
//todo: OK to remove this unused assignment? Or is some implementation missing?
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, it looks like in all cases the generated cache ID isn't being used but the ID passed as a parameter into the methods is. So either fix all of them to use the generated cache ID or just remove the calls.

@wilsonge wilsonge merged commit 57337f7 into joomla:staging Dec 30, 2016
@wilsonge
Copy link
Contributor

Awesome - Thanks!

@frankmayer frankmayer deleted the improvements-in-tests-4 branch January 4, 2017 07:15
@zero-24 zero-24 added this to the Joomla 3.7.0 milestone Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants