joomla/joomla-framework — pull request #330 by garyamort (2014-01-14 22:29:01+00:00)
Title: Enable and fix basic Memcached unit testing on travis

Enabled Memcached extension for travis - both session and cache Memcache engines were broken and would not even pass their own unit tests[what few there were] - but without the extension enabled the tests would not run.

Also modifies the following testing classes for Cache:
CacheTest, MemcachedTest

CacheTest now uses static protected variable and late static binding on calls to implement over 90% of the unit tests[previously only 10% were not skipped]
MemcachedTest now inherits from CacheTest and contains almost no unit tests of it's own[most of the tests from CacheTest are valid for it as well]. As with CacheTest, this brings method coverage up to 90% from 0%.

Modifies the following testing classes for Session:
StorageTest, MemcachedTest
Does the same thing for Session as was done for Cache.

Modifications to actual Joomla Framework classes:
Joomla\Cache\Memcached constructor was modified:

Connect depends on $this->options['memcache.pool'] to be something[it can be false, but it has to be there]. This issue causes all other unit tests to fail. Modified constructor flow to
1) Check to see the Memcached extensions exists before anything else
2) Call the parent constructor second as it has common code needed for checking the $options argument
3) Lastly, before returning ensure that $this->options['memcache.pool'] exists and creates it if it does not.

Joomla\Session\Storage\Memcached constructor was modified:

register depends on $this->_servers in order to function. Parent class Joomla\Session\Storage::_construct() calls $this->register. But $this->_servers was not configured until afterward - thus this session storage class was not usable at all. Similiar changes were made in timing in order to get this class to work as were made to Joomla\Cache\Memcached

Note: this is the third time I've submitted these bug fixes.