unittests/mockSerializer.js
branchpopcorn-port
changeset 157 73bce42a3ed3
parent 128 f3fec80dd31c
child 182 5fc357f62af1
--- a/unittests/mockSerializer.js	Wed Oct 26 17:21:35 2011 +0200
+++ b/unittests/mockSerializer.js	Thu Oct 27 11:22:49 2011 +0200
@@ -4,8 +4,22 @@
 
 IriSP.MockSerializer = function(DataLoader, url) {
   IriSP.Serializer.call(this, DataLoader, url);
+  this._data = _data;
+};
 
-  this._data = { "tags": [
+IriSP.MockSerializer.prototype = new IriSP.Serializer();   
+
+IriSP.MockSerializer.prototype.currentMedia = function() {
+  return this._data.medias[0];
+};
+
+// Copy some methods from JSONSerializer because we need them in
+// some tests.
+
+IriSP.MockSerializer.prototype.searchAnnotations = IriSP.JSONSerializer.prototype.searchAnnotations;
+IriSP.MockSerializer.prototype.searchOccurences = IriSP.JSONSerializer.prototype.searchOccurences;
+
+var _data = { "tags": [
       {
           "meta": {
             "dc:contributor": "IRI ", 
@@ -1458,12 +1472,4 @@
           "dc:description": "", 
           "dc:modified": "2010-09-06T15:53:44.699595"
         }
-      ]
-};
-};
-
-IriSP.MockSerializer.prototype = new IriSP.Serializer();   
-
-IriSP.MockSerializer.prototype.currentMedia = function() {
-  return this._data.medias[0];
-};
+      ]};
\ No newline at end of file