1 | <?php |
||
16 | class LocationParserTest extends \ValueParsers\Test\StringValueParserTest { |
||
17 | |||
18 | /** |
||
19 | * @return string |
||
20 | */ |
||
21 | protected function getParserClass() { |
||
24 | |||
25 | /** |
||
26 | * @see ValueParserTestBase::validInputProvider |
||
27 | * |
||
28 | * @since 3.0 |
||
29 | * |
||
30 | * @return array |
||
31 | */ |
||
32 | public function validInputProvider() { |
||
57 | |||
58 | /** |
||
59 | * @see ValueParserTestBase::requireDataValue |
||
60 | * |
||
61 | * @since 3.0 |
||
62 | * |
||
63 | * @return boolean |
||
64 | */ |
||
65 | protected function requireDataValue() { |
||
68 | |||
69 | /** |
||
70 | * @dataProvider titleProvider |
||
71 | */ |
||
72 | public function testGivenTitleThatIsNotLink_titleIsSetAndLinkIsNot( $title ) { |
||
78 | |||
79 | public function titleProvider() { |
||
88 | |||
89 | protected function assertTitleAndLinkAre( Location $location, $title, $link ) { |
||
93 | |||
94 | protected function assertHasJsonKeyWithValue( Location $polygon, $key, $value ) { |
||
103 | |||
104 | /** |
||
105 | * @dataProvider linkProvider |
||
106 | */ |
||
107 | public function testGivenTitleThatIsLink_linkIsSetAndTitleIsNot( $link ) { |
||
113 | |||
114 | public function linkProvider() { |
||
121 | |||
122 | /** |
||
123 | * @dataProvider titleLinkProvider |
||
124 | */ |
||
125 | // public function testGivenPageTitleAsLink_pageTitleIsTurnedIntoUrl( $link ) { |
||
126 | // $parser = new LocationParser(); |
||
127 | // $location = $parser->parse( '4,2~link:' . $link ); |
||
128 | // |
||
129 | // $linkUrl = Title::newFromText( $link )->getFullURL(); |
||
130 | // $this->assertTitleAndLinkAre( $location, '', $linkUrl ); |
||
131 | // } |
||
132 | // |
||
133 | // public function titleLinkProvider() { |
||
134 | // return array( |
||
135 | // array( 'Foo' ), |
||
136 | // array( 'Some_Page' ), |
||
137 | // ); |
||
138 | // } |
||
139 | |||
140 | protected function getInstance() { |
||
143 | |||
144 | public function testGivenAddressAndNoTitle_addressIsSetAsTitle() { |
||
149 | |||
150 | public function testGivenAddressAndTitle_addressIsNotUsedAsTitle() { |
||
155 | |||
156 | public function testGivenCoordinatesAndNoTitle_noTitleIsSet() { |
||
161 | |||
162 | } |
||
163 |