1 | <?php |
||
17 | class LocationParserTest extends TestCase { |
||
18 | |||
19 | private $geocoder; |
||
20 | private $fileUrlFinder; |
||
21 | private $useAddressAsTitle; |
||
22 | |||
23 | public function setUp(): void { |
||
28 | |||
29 | private function newLocationParser() { |
||
32 | |||
33 | /** |
||
34 | * @dataProvider titleProvider |
||
35 | */ |
||
36 | public function testGivenTitleThatIsNotLink_titleIsSetAndLinkIsNot( $title ) { |
||
41 | |||
42 | protected function assertTitleAndLinkAre( Location $location, $title, $link ) { |
||
46 | |||
47 | protected function assertHasJsonKeyWithValue( Location $polygon, $key, $value ) { |
||
53 | |||
54 | public function titleProvider() { |
||
63 | |||
64 | /** |
||
65 | * @dataProvider linkProvider |
||
66 | */ |
||
67 | public function testGivenTitleThatIsLink_linkIsSetAndTitleIsNot( $link ) { |
||
72 | |||
73 | public function linkProvider() { |
||
79 | |||
80 | // /** |
||
81 | // * @dataProvider titleLinkProvider |
||
82 | // */ |
||
83 | // public function testGivenPageTitleAsLink_pageTitleIsTurnedIntoUrl( $link ) { |
||
84 | // $parser = new LocationParser(); |
||
85 | // $location = $parser->parse( '4,2~link:' . $link ); |
||
86 | // |
||
87 | // $linkUrl = Title::newFromText( $link )->getFullURL(); |
||
88 | // $this->assertTitleAndLinkAre( $location, '', $linkUrl ); |
||
89 | // } |
||
90 | // |
||
91 | // public function titleLinkProvider() { |
||
92 | // return array( |
||
93 | // array( 'Foo' ), |
||
94 | // array( 'Some_Page' ), |
||
95 | // ); |
||
96 | // } |
||
97 | |||
98 | public function testGivenAddressAndNoTitle_addressIsSetAsTitle() { |
||
104 | |||
105 | public function testGivenAddressAndTitle_addressIsNotUsedAsTitle() { |
||
111 | |||
112 | public function testGivenCoordinatesAndNoTitle_noTitleIsSet() { |
||
118 | |||
119 | } |
||
120 |