]> dev.renevier.net Git - syp.git/blob - openlayers/tests/Protocol.html
initial commit
[syp.git] / openlayers / tests / Protocol.html
1 <html>
2 <head>
3   <script src="../lib/OpenLayers.js"></script>
4   <script type="text/javascript">
5
6     function test_initialize(t) {
7         t.plan(3);
8         var options = {};
9         var protocol = new OpenLayers.Protocol(options);
10
11         t.ok(protocol instanceof OpenLayers.Protocol,
12              "new OpenLayers.Protocol returns object" );
13         t.eq(protocol.options, options, "constructor sets this.options");
14         t.eq(protocol.autoDestroy, true, "constructor does not modify this.autoDestroy");
15     }
16     
17     function test_destroy(t) {
18         t.plan(2);
19         var protocol = new OpenLayers.Protocol({
20             options: {foo: 'bar'},
21             format: 'foo'
22         });
23         protocol.destroy();
24
25         t.eq(protocol.format, null, "destroy nullify protocol.format");
26         t.eq(protocol.options, null, "destroy nullify protocol.options");
27     }
28
29   </script>
30 </head>
31 <body>
32 </body>
33 </html>