jonnybarnes.uk/tests/Unit/PlacesTest.php

22 lines
429 B
PHP
Raw Normal View History

2017-02-18 14:31:49 +00:00
<?php
namespace Tests\Unit;
use App\Place;
use Tests\TestCase;
2017-05-30 20:07:40 +01:00
use Phaza\LaravelPostgis\Geometries\Point;
2017-02-18 14:31:49 +00:00
class PlacesTest extends TestCase
{
/**
* Test the near method returns a collection.
*
* @return void
*/
public function test_near_method()
{
2017-05-30 20:07:40 +01:00
$nearby = Place::near(new Point(53.5, -2.38), 1000)->get();
2017-02-18 14:31:49 +00:00
$this->assertEquals('the-bridgewater-pub', $nearby[0]->slug);
}
}