You are here

function RecommenderTestCase::testAppFunctions in Recommender API 7.5

Same name and namespace in other branches
  1. 6.3 recommender.test \RecommenderTestCase::testAppFunctions()
  2. 7.3 recommender.test \RecommenderTestCase::testAppFunctions()
  3. 7.4 recommender.test \RecommenderTestCase::testAppFunctions()

File

./recommender.test, line 74

Class

RecommenderTestCase

Code

function testAppFunctions() {
  $id1 = recommender_app_load('test_item2item', TRUE);
  $id2 = db_query('SELECT id FROM {recommender_app} WHERE name=:name', array(
    ':name' => 'test_item2item',
  ))
    ->fetchField();
  $this
    ->assertEqual($id1, $id2);
  $app = recommender_app_load('test_user2user');
  $this
    ->assertEqual($app['params']['performance'], 'database');
  recommender_app_update('test_user2user', array(
    'performance' => 'memory',
  ));
  $app = recommender_app_load('test_user2user');
  $this
    ->assertEqual($app['params']['performance'], 'memory');
  recommender_app_update('test_user2user', array(
    'preference' => 'database',
  ));
}