unittests/mockSerializer.js
branchpopcorn-port
changeset 323 3cb8b5017080
parent 183 d471599e1b2c
equal deleted inserted replaced
322:6fc87426ecd4 323:3cb8b5017080
     5 IriSP.MockSerializer = function(DataLoader, url) {
     5 IriSP.MockSerializer = function(DataLoader, url) {
     6   IriSP.Serializer.call(this, DataLoader, url);
     6   IriSP.Serializer.call(this, DataLoader, url);
     7   this._data = IriSP.MockSerializer.prototype._data;
     7   this._data = IriSP.MockSerializer.prototype._data;
     8 };
     8 };
     9 
     9 
    10 IriSP.MockSerializer.prototype = new IriSP.Serializer();   
    10 IriSP.MockSerializer.prototype = new IriSP.JSONSerializer();   
    11 
    11 
    12 IriSP.MockSerializer.prototype.currentMedia = function() {
    12 IriSP.MockSerializer.prototype.currentMedia = function() {
    13   return this._data.medias[0];
    13   return this._data.medias[0];
    14 };
    14 };
    15 
    15 
    16 // Copy some methods from JSONSerializer because we need them in
    16 IriSP.MockSerializer.prototype.sync = IriSP.Serializer.prototype.sync;
    17 // some tests.
       
    18 
       
    19 IriSP.MockSerializer.prototype.searchAnnotations = IriSP.JSONSerializer.prototype.searchAnnotations;
       
    20 IriSP.MockSerializer.prototype.searchOccurences = IriSP.JSONSerializer.prototype.searchOccurences;
       
    21 
    17 
    22 IriSP.MockSerializer.prototype._data = { "tags": [
    18 IriSP.MockSerializer.prototype._data = { "tags": [
    23       {
    19       {
    24           "meta": {
    20           "meta": {
    25             "dc:contributor": "IRI ", 
    21             "dc:contributor": "IRI ",