3 <script src="../lib/OpenLayers.js"></script>
4 <script type="text/javascript">
5 function test_Projection_constructor(t) {
8 var options = {'foo': 'bar'};
9 var projection = new OpenLayers.Projection("code", options);
10 t.ok(projection instanceof OpenLayers.Projection,
11 "new OpenLayers.Projection returns object" );
12 t.eq(projection.projCode, "code", "The proj code is maintained");
13 t.eq(projection.getCode(), "code", "The proj code is maintained.");
14 t.eq(projection.getUnits(), null, "Null units with no proj4js library.");
15 t.eq(projection.foo, "bar", "constructor sets options correctly");
17 var projection2 = new OpenLayers.Projection("epsg:4325", options);
18 out = OpenLayers.Projection.transform({'x':10,'y':12}, projection, projection2);
19 t.eq(out.x, 10, "Null transform has no effect");
20 t.eq(out.y, 12, "Null transform has no effect");
22 t.eq(projection.equals(null), false, "equals on null projection returns false");
23 t.eq(projection.equals({}), false, "equals on null projection object returns false (doesn't call getCode)");