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
[ticket/9983] Add redis cache driver tests. #1108
Conversation
In order to not overwrite data in default redis store, at least one of redis host or post must be explicitly specified. Redis cache driver constructor has been modified to accept host and port as parameters. This was not added to public API as there are more parameters being passed via global constants. PHPBB3-9983
$db->sql_close(); | ||
} | ||
|
||
public function test_cache_sql_redis() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those should probably go into different classes/files now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One per driver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an abstract base class containing all the tests that all implementation are supposed to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are not actually the same.
File count increased. |
No common tests in base class? Basic set/get test? |
PHPBB3-9983
PHPBB3-9983
PHPBB3-9983
PHPBB3-9983
Added more tests. |
@@ -7,11 +7,12 @@ | |||
* | |||
*/ | |||
|
|||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; | |||
require_once dirname(__FILE__) . '/common_test_case.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autoloading?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently have no autoloading for test related classes. But I'm not against adding it, perhaps in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I thought tests already support it. In that case it's fine.
Unfortunately my distribution does not come with redis php bindings, so can not test this trivially. |
I don't think many do. I built the thing from source. |
or port must be specified in test configuration. This can be done via | ||
test_config.php as follows: | ||
|
||
<? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.
PHPBB3-9983
PHPBB3-9983
PHPBB3-9983
Fixed and added apc. Tried adding xcache but it was failing too much. |
https://gist.github.com/81423875ef085e6905ee scroll down for my conclusion. |
|
Merge p#34 |
In order to not overwrite data in default redis store, at least
one of redis host or post must be explicitly specified.
Redis cache driver constructor has been modified to accept
host and port as parameters. This was not added to public API
as there are more parameters being passed via global constants.
http://tracker.phpbb.com/browse/PHPBB3-9983