Enable cache extension in travis build

This commit is contained in:
Romain Neutron
2013-06-01 12:23:27 +02:00
parent 59162e73fb
commit aa64d38c3b
5 changed files with 17 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ before_script:
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then pecl install redis; fi;'
- echo 'extension="memcache.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcache.ini
- echo 'extension="memcached.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcached.ini
- bower install
- composer self-update
- composer install --dev --prefer-source

View File

@@ -169,12 +169,15 @@ class databox extends base
public function set_viewname($viewname)
{
$this->load();
$sql = 'UPDATE sbas SET viewname = :viewname WHERE sbas_id = :sbas_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute(array(':viewname' => $viewname, ':sbas_id' => $this->id));
$stmt->closeCursor();
$this->delete_data_from_cache(static::CACHE_BASE_DATABOX);
$this->app['phraseanet.appbox']->delete_data_from_cache(appbox::CACHE_LIST_BASES);
cache_databox::update($this->app, $this->id, 'structure');

View File

@@ -13,9 +13,13 @@ class ApcCacheTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
if ( ! extension_loaded('apc') || ! ini_get('apc.enable_cli')) {
if (!extension_loaded('apc')) {
$this->markTestSkipped('Apc is not installed');
}
if (!ini_get('apc.enable_cli')) {
$this->markTestSkipped('Apc is not loaded in CLI');
}
$this->object = new ApcCache;
}

View File

@@ -17,7 +17,7 @@ class RedisTest extends \PhraseanetPHPUnitAbstract
$ok = false;
}
if (! $ok) {
$this->markTestSkipped('The ' . __CLASS__ . ' requires the use of redis');
$this->markTestSkipped('The ' . __CLASS__ . ' cannot connect to redis');
}
} else {
$this->markTestSkipped('The ' . __CLASS__ . ' requires the use of redis');

View File

@@ -453,6 +453,11 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
$this->setAdmin(true);
$databox = self::$DI['app']['phraseanet.appbox']->get_databox(self::$DI['collection']->get_sbas_id());
$databox->set_viewname('old_databox_name');
$this->assertEquals('old_databox_name', $databox->get_viewname());
$this->XMLHTTPRequest('POST', '/admin/databox/' . self::$DI['collection']->get_sbas_id() . '/view-name/', array(
'viewname' => 'new_databox_name'
));
@@ -464,7 +469,7 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$this->assertTrue(is_object($content));
$this->assertObjectHasAttribute('sbas_id', $content, $response->getContent());
$databox = new \databox(self::$DI['app'], self::$DI['collection']->get_sbas_id());
$databox = self::$DI['app']['phraseanet.appbox']->get_databox(self::$DI['collection']->get_sbas_id());
$this->assertEquals('new_databox_name', $databox->get_viewname());
}