@@ -47,13 +47,13 @@ public function testLoad(string $filename, int $records, int|null $parts): void
47
47
{
48
48
$ shp = new ShapeFile (ShapeType::Point);
49
49
$ shp ->loadFromFile ($ filename );
50
- $ this -> assertEquals ('' , $ shp ->lastError );
51
- $ this -> assertEquals ($ records , count ($ shp ->records ));
50
+ self :: assertEquals ('' , $ shp ->lastError );
51
+ self :: assertEquals ($ records , count ($ shp ->records ));
52
52
if ($ parts === null ) {
53
53
return ;
54
54
}
55
55
56
- $ this -> assertEquals ($ parts , count ($ shp ->records [0 ]->shpData ['parts ' ]));
56
+ self :: assertEquals ($ parts , count ($ shp ->records [0 ]->shpData ['parts ' ]));
57
57
}
58
58
59
59
/**
@@ -108,7 +108,7 @@ public function testLoadError(string $filename): void
108
108
{
109
109
$ shp = new ShapeFile (ShapeType::Point);
110
110
$ shp ->loadFromFile ($ filename );
111
- $ this -> assertNotEquals ('' , $ shp ->lastError );
111
+ self :: assertNotEquals ('' , $ shp ->lastError );
112
112
}
113
113
114
114
/**
@@ -119,12 +119,12 @@ public function testLoadEmptyFilename(): void
119
119
$ shp = new ShapeFile (ShapeType::Point);
120
120
$ shp ->loadFromFile ('' );
121
121
if (ShapeFile::supportsDbase ()) {
122
- $ this -> assertEquals ('It wasn \'t possible to find the DBase file "" ' , $ shp ->lastError );
122
+ self :: assertEquals ('It wasn \'t possible to find the DBase file "" ' , $ shp ->lastError );
123
123
124
124
return ;
125
125
}
126
126
127
- $ this -> assertEquals ('Not a SHP file (file code mismatch) ' , $ shp ->lastError );
127
+ self :: assertEquals ('Not a SHP file (file code mismatch) ' , $ shp ->lastError );
128
128
}
129
129
130
130
/**
@@ -133,7 +133,7 @@ public function testLoadEmptyFilename(): void
133
133
public function testGetDBFHeader (): void
134
134
{
135
135
$ shp = new ShapeFile (ShapeType::Point);
136
- $ this -> assertNull ($ shp ->getDBFHeader ());
136
+ self :: assertNull ($ shp ->getDBFHeader ());
137
137
}
138
138
139
139
/**
@@ -222,14 +222,14 @@ private function createTestData(): void
222
222
public function testCreate (): void
223
223
{
224
224
if (! ShapeFile::supportsDbase ()) {
225
- $ this -> markTestSkipped ('dbase extension missing ' );
225
+ self :: markTestSkipped ('dbase extension missing ' );
226
226
}
227
227
228
228
$ this ->createTestData ();
229
229
230
230
$ shp = new ShapeFile (ShapeType::Point);
231
231
$ shp ->loadFromFile ('./data/test_shape.* ' );
232
- $ this -> assertEquals (4 , count ($ shp ->records ));
232
+ self :: assertEquals (4 , count ($ shp ->records ));
233
233
}
234
234
235
235
/**
@@ -238,7 +238,7 @@ public function testCreate(): void
238
238
public function testDelete (): void
239
239
{
240
240
if (! ShapeFile::supportsDbase ()) {
241
- $ this -> markTestSkipped ('dbase extension missing ' );
241
+ self :: markTestSkipped ('dbase extension missing ' );
242
242
}
243
243
244
244
$ this ->createTestData ();
@@ -247,11 +247,11 @@ public function testDelete(): void
247
247
$ shp ->loadFromFile ('./data/test_shape.* ' );
248
248
$ shp ->deleteRecord (1 );
249
249
$ shp ->saveToFile ();
250
- $ this -> assertEquals (3 , count ($ shp ->records ));
250
+ self :: assertEquals (3 , count ($ shp ->records ));
251
251
252
252
$ shp = new ShapeFile (ShapeType::Point);
253
253
$ shp ->loadFromFile ('./data/test_shape.* ' );
254
- $ this -> assertEquals (3 , count ($ shp ->records ));
254
+ self :: assertEquals (3 , count ($ shp ->records ));
255
255
}
256
256
257
257
/**
@@ -260,7 +260,7 @@ public function testDelete(): void
260
260
public function testAdd (): void
261
261
{
262
262
if (! ShapeFile::supportsDbase ()) {
263
- $ this -> markTestSkipped ('dbase extension missing ' );
263
+ self :: markTestSkipped ('dbase extension missing ' );
264
264
}
265
265
266
266
$ this ->createTestData ();
@@ -276,11 +276,11 @@ public function testAdd(): void
276
276
$ shp ->records [4 ]->dbfData ['DESC ' ] = 'CCCCCCCCCCC ' ;
277
277
278
278
$ shp ->saveToFile ();
279
- $ this -> assertEquals (5 , count ($ shp ->records ));
279
+ self :: assertEquals (5 , count ($ shp ->records ));
280
280
281
281
$ shp = new ShapeFile (ShapeType::Point);
282
282
$ shp ->loadFromFile ('./data/test_shape.* ' );
283
- $ this -> assertEquals (5 , count ($ shp ->records ));
283
+ self :: assertEquals (5 , count ($ shp ->records ));
284
284
}
285
285
286
286
/**
@@ -291,7 +291,7 @@ public function testSaveNoDBF(): void
291
291
$ shp = new ShapeFile (ShapeType::Point);
292
292
$ shp ->saveToFile ('./data/test_nodbf.* ' );
293
293
294
- $ this -> assertFileDoesNotExist ('./data/test_nodbf.dbf ' );
294
+ self :: assertFileDoesNotExist ('./data/test_nodbf.dbf ' );
295
295
}
296
296
297
297
/**
@@ -300,13 +300,13 @@ public function testSaveNoDBF(): void
300
300
public function testShapeName (): void
301
301
{
302
302
$ obj = new ShapeRecord (ShapeType::Point);
303
- $ this -> assertEquals ('Point ' , $ obj ->getShapeName ());
303
+ self :: assertEquals ('Point ' , $ obj ->getShapeName ());
304
304
$ obj = new ShapeFile (ShapeType::Point);
305
- $ this -> assertEquals ('Point ' , $ obj ->getShapeName ());
305
+ self :: assertEquals ('Point ' , $ obj ->getShapeName ());
306
306
$ obj = new ShapeRecord (ShapeType::Null);
307
- $ this -> assertEquals ('Null Shape ' , $ obj ->getShapeName ());
307
+ self :: assertEquals ('Null Shape ' , $ obj ->getShapeName ());
308
308
$ obj = new ShapeRecord (ShapeType::Unknown);
309
- $ this -> assertEquals ('Unknown Shape ' , $ obj ->getShapeName ());
309
+ self :: assertEquals ('Unknown Shape ' , $ obj ->getShapeName ());
310
310
}
311
311
312
312
/**
@@ -335,7 +335,7 @@ public function testShapeSaveLoad(ShapeType $shapeType, array $points): void
335
335
$ shp2 = new ShapeFile ($ shapeType );
336
336
$ shp2 ->loadFromFile ($ filename );
337
337
338
- $ this -> assertEquals (count ($ shp ->records ), count ($ shp2 ->records ));
338
+ self :: assertEquals (count ($ shp ->records ), count ($ shp2 ->records ));
339
339
340
340
$ record = $ shp ->records [0 ];
341
341
$ record2 = $ shp2 ->records [0 ];
@@ -346,7 +346,7 @@ public function testShapeSaveLoad(ShapeType $shapeType, array $points): void
346
346
continue ;
347
347
}
348
348
349
- $ this -> assertEquals ($ record ->shpData [$ item ], $ record2 ->shpData [$ item ]);
349
+ self :: assertEquals ($ record ->shpData [$ item ], $ record2 ->shpData [$ item ]);
350
350
}
351
351
352
352
/* Test deletion works */
@@ -405,15 +405,15 @@ public function testSearch(): void
405
405
$ shp = new ShapeFile (ShapeType::Null);
406
406
$ shp ->loadFromFile ('data/capitals.* ' );
407
407
/* Nonexisting entry or no dbase support */
408
- $ this -> assertEquals (
408
+ self :: assertEquals (
409
409
-1 ,
410
410
$ shp ->getIndexFromDBFData ('CNTRY_NAME ' , 'nonexisting ' ),
411
411
);
412
412
if (! ShapeFile::supportsDbase ()) {
413
413
return ;
414
414
}
415
415
416
- $ this -> assertEquals (
416
+ self :: assertEquals (
417
417
218 ,
418
418
$ shp ->getIndexFromDBFData ('CNTRY_NAME ' , 'Czech Republic ' ),
419
419
);
0 commit comments