public/phpmyadmin/vendor/phpmyadmin/shapefile/tests/ShapeFileTest.php
/**
     * Test adding record to a file.
     */
Test adding record to a file.
Test adding record to a file .
public function testAdd()
    {
        if (!ShapeFile::supports_dbase()) {
            $this->markTestSkipped('dbase extension missing');
        }
        $this->createTestData();
        $shp = new ShapeFile(1);
        $shp->loadFromFile('./data/test_shape.*');
        $record0 = new ShapeRecord(1);
        $record0->addPoint(array('x' => 482131.764567, 'y' => 2143634.39608));
        $shp->addRecord($record0);
        $shp->records[4]->DBFData['ID'] = '4';
        $shp->records[4]->DBFData['DESC'] = 'CCCCCCCCCCC';
        $shp->saveToFile();
        $this->assertEquals(5, count($shp->records));
        $shp = new ShapeFile(1);
        $shp->loadFromFile('./data/test_shape.*');
        $this->assertEquals(5, count($shp->records));
    }
public function testAdd ( ) { if ( ! ShapeFile :: supports_dbase ( ) ) { $ this -> markTestSkipped ( 'dbase extension missing' ) ; } $ this -> createTestData ( ) ; $ shp = new ShapeFile ( 1 ) ; $ shp -> loadFromFile ( './data/test_shape.*' ) ; $ record0 = new ShapeRecord ( 1 ) ; $ record0 -> addPoint ( array ( 'x' => 482131.764567 , 'y' => 2143634.39608 ) ) ; $ shp -> addRecord ( $ record0 ) ; $ shp -> records [ 4 ] -> DBFData [ 'ID' ] = '4' ; $ shp -> records [ 4 ] -> DBFData [ 'DESC' ] = 'CCCCCCCCCCC' ; $ shp -> saveToFile ( ) ; $ this -> assertEquals ( 5 , count ( $ shp -> records ) ) ; $ shp = new ShapeFile ( 1 ) ; $ shp -> loadFromFile ( './data/test_shape.*' ) ; $ this -> assertEquals ( 5 , count ( $ shp -> records ) ) ; }
Test adding record to a file.
Test adding record to a file .