Source of file NearestPOIPage_ControllerTest.php
Size: 1,793 Bytes - Last Modified: 2021-12-23T10:58:59+00:00
/var/www/docs.ssmods.com/process/src/tests/NearestPOIPage_ControllerTest.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 | <?php class NearestPOIPage_ControllerTest extends FunctionalTest { protected static $fixture_file = 'mappable-poi/tests/pointsofinterest.yml'; public function testFind() { // page needs to be live $nearPage = $this->objFromFixture('NearestPOIPage', 'StationFinder'); $this->logInWithPermission('ADMIN'); $nearPage->doPublish(); if (Member::currentUser()) { Member::currentUser()->logOut(); } $link = $nearPage->Link(); error_log('POI PAGE LINK:'.$link); $url = $link; error_log('TRYING URL '.$url); $response = $this->get($url); $this->assertEquals(200, $response->getStatusCode()); // location is MBK $url = $link.'find?lat=13.7444513&lng=100.5290196'; $response = $this->get($url); $this->assertEquals(200, $response->getStatusCode()); $expected = array( 'Ratchathewi', 'Phaya Thai', 'Chit Lom', 'Victory Monument', 'Nana', 'Sanam Pao', 'Ari', 'Saphan Khwai', 'Mo Chit', ); $this->assertExactMatchBySelector('table#nearestPOIs td.name', $expected); // location is victory monument $url = $link.'find?lat=13.7650776&lng=100.5369724'; $response = $this->get($url); $this->assertEquals(200, $response->getStatusCode()); $expected = array( 'Victory Monument', 'Phaya Thai', 'Sanam Pao', 'Ratchathewi', 'Ari', 'Chit Lom', 'Nana', 'Saphan Khwai', 'Mo Chit', ); $this->assertExactMatchBySelector('table#nearestPOIs td.name', $expected); } } |