1 | <?php |
||
17 | class LocationParserTest extends \ValueParsers\Test\StringValueParserTest { |
||
18 | |||
19 | public function setUp() { |
||
24 | |||
25 | /** |
||
26 | * @return string |
||
27 | */ |
||
28 | protected function getParserClass() { |
||
31 | |||
32 | /** |
||
33 | * @see ValueParserTestBase::validInputProvider |
||
34 | * |
||
35 | * @since 3.0 |
||
36 | * |
||
37 | * @return array |
||
38 | */ |
||
39 | public function validInputProvider() { |
||
64 | |||
65 | /** |
||
66 | * @see ValueParserTestBase::requireDataValue |
||
67 | * |
||
68 | * @since 3.0 |
||
69 | * |
||
70 | * @return boolean |
||
71 | */ |
||
72 | protected function requireDataValue() { |
||
75 | |||
76 | /** |
||
77 | * @dataProvider titleProvider |
||
78 | */ |
||
79 | public function testGivenTitleThatIsNotLink_titleIsSetAndLinkIsNot( $title ) { |
||
85 | |||
86 | public function titleProvider() { |
||
95 | |||
96 | protected function assertTitleAndLinkAre( Location $location, $title, $link ) { |
||
100 | |||
101 | protected function assertHasJsonKeyWithValue( Location $polygon, $key, $value ) { |
||
110 | |||
111 | /** |
||
112 | * @dataProvider linkProvider |
||
113 | */ |
||
114 | public function testGivenTitleThatIsLink_linkIsSetAndTitleIsNot( $link ) { |
||
120 | |||
121 | public function linkProvider() { |
||
128 | |||
129 | /** |
||
130 | * @dataProvider titleLinkProvider |
||
131 | */ |
||
132 | // public function testGivenPageTitleAsLink_pageTitleIsTurnedIntoUrl( $link ) { |
||
133 | // $parser = new LocationParser(); |
||
134 | // $location = $parser->parse( '4,2~link:' . $link ); |
||
135 | // |
||
136 | // $linkUrl = Title::newFromText( $link )->getFullURL(); |
||
137 | // $this->assertTitleAndLinkAre( $location, '', $linkUrl ); |
||
138 | // } |
||
139 | // |
||
140 | // public function titleLinkProvider() { |
||
141 | // return array( |
||
142 | // array( 'Foo' ), |
||
143 | // array( 'Some_Page' ), |
||
144 | // ); |
||
145 | // } |
||
146 | |||
147 | protected function getInstance() { |
||
150 | |||
151 | public function testGivenAddressAndNoTitle_addressIsSetAsTitle() { |
||
158 | |||
159 | public function testGivenAddressAndTitle_addressIsNotUsedAsTitle() { |
||
166 | |||
167 | public function testGivenCoordinatesAndNoTitle_noTitleIsSet() { |
||
174 | |||
175 | } |
||
176 |