Passed
Push — testing ( 57c125...199f7f )
by Hennik
03:23
created

BlueprintTest::testPolygon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Schema;
4
5
use BaseTestCase;
6
use LaravelSpatial\Schema\Blueprint;
7
use Mockery;
8
9
class BlueprintTest extends BaseTestCase
10
{
11
    protected $blueprint;
12
13
    public function setUp()
14
    {
15
        parent::setUp();
16
17
        $this->blueprint = Mockery::mock(Blueprint::class)
18
            ->makePartial()->shouldAllowMockingProtectedMethods();
19
    }
20
21
    public function testGeometry()
22
    {
23
        $this->blueprint
24
            ->shouldReceive('addColumn')
25
            ->with('geometry', 'col')
26
            ->once();
27
28
        $this->blueprint->geometry('col');
29
    }
30
31
    public function testPoint()
32
    {
33
        $this->blueprint
34
            ->shouldReceive('addColumn')
35
            ->with('point', 'col', ['srid' => null])
36
            ->once();
37
38
        $this->blueprint->point('col');
39
    }
40
41
    public function testLinestring()
42
    {
43
        $this->blueprint
44
            ->shouldReceive('addColumn')
45
            ->with('linestring', 'col')
46
            ->once();
47
48
        $this->blueprint->linestring('col');
49
    }
50
51
    public function testPolygon()
52
    {
53
        $this->blueprint
54
            ->shouldReceive('addColumn')
55
            ->with('polygon', 'col')
56
            ->once();
57
58
        $this->blueprint->polygon('col');
59
    }
60
61
    public function testMultiPoint()
62
    {
63
        $this->blueprint
64
            ->shouldReceive('addColumn')
65
            ->with('multipoint', 'col')
66
            ->once();
67
68
        $this->blueprint->multipoint('col');
69
    }
70
71
    public function testMultiLineString()
72
    {
73
        $this->blueprint
74
            ->shouldReceive('addColumn')
75
            ->with('multilinestring', 'col')
76
            ->once();
77
78
        $this->blueprint->multilinestring('col');
79
    }
80
81
    public function testMulltiPolygon()
82
    {
83
        $this->blueprint
84
            ->shouldReceive('addColumn')
85
            ->with('multipolygon', 'col')
86
            ->once();
87
88
        $this->blueprint->multipolygon('col');
89
    }
90
91
    public function testGeometryCollection()
92
    {
93
        $this->blueprint
94
            ->shouldReceive('addColumn')
95
            ->with('geometrycollection', 'col')
96
            ->once();
97
98
        $this->blueprint->geometrycollection('col');
99
    }
100
101
    public function testEnablePostgis()
102
    {
103
        $this->blueprint
104
            ->shouldReceive('addCommand')
105
            ->with('enablePostgis')
106
            ->once();
107
108
        $this->blueprint->enablePostgis();
109
    }
110
111
    public function testDisablePostgis()
112
    {
113
        $this->blueprint
114
            ->shouldReceive('addCommand')
115
            ->with('disablePostgis')
116
            ->once();
117
118
        $this->blueprint->disablePostgis();
119
    }
120
}
121