Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PMA_GIS_Factory_test.php « gis « classes « test - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 90562c8666d0e7889fb694e3b3eca79cd37066cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Test for PMA_GIS_Factory
 *
 * @package PhpMyAdmin-test
 */
require_once 'libraries/gis/GIS_Geometry.class.php';
require_once 'libraries/gis/GIS_Linestring.class.php';
require_once 'libraries/gis/GIS_Multilinestring.class.php';
require_once 'libraries/gis/GIS_Point.class.php';
require_once 'libraries/gis/GIS_Multipoint.class.php';
require_once 'libraries/gis/GIS_Polygon.class.php';
require_once 'libraries/gis/GIS_Multipolygon.class.php';
require_once 'libraries/gis/GIS_Geometrycollection.class.php';

/*
 * Include to test
 */
require_once 'libraries/gis/GIS_Factory.class.php';

/**
 * Test class for PMA_GIS_Factory
 *
 * @package PhpMyAdmin-test
 */
class PMA_GIS_FactoryTest extends PHPUnit_Framework_TestCase
{

    /**
     * Test factory method
     *
     * @param string $type geometry type
     * @param object $geom geometry object
     *
     * @dataProvider providerForTestFactory
     * @return void
     */
    public function testFactory($type, $geom)
    {
        $this->assertInstanceOf($geom, PMA_GIS_Factory::factory($type));
    }

    /**
     * data provider for testFactory
     *
     * @return data for testFactory
     */
    public function providerForTestFactory()
    {
        return array(
            array(
                'MULTIPOLYGON',
                'PMA_GIS_Multipolygon'
            ),
            array(
                'POLYGON',
                'PMA_GIS_Polygon'
            ),
            array(
                'MULTILINESTRING',
                'PMA_GIS_Multilinestring'
            ),
            array(
                'LINESTRING',
                'PMA_GIS_Linestring'
            ),
            array(
                'MULTIPOINT',
                'PMA_GIS_Multipoint'
            ),
            array(
                'POINT',
                'PMA_GIS_Point'
            ),
            array(
                'GEOMETRYCOLLECTION',
                'PMA_GIS_Geometrycollection'
            ),
        );
    }
}
?>