Skip to content

Commit ce6fb8c

Browse files
committed
Fixed tests namespaces
1 parent a77e8a0 commit ce6fb8c

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

tests/Feature/Models/GeometryModel.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<?php
2-
namespace Grimzy\LaravelSpatial\Tests\Feature\Models;
3-
42
use Grimzy\LaravelSpatial\Eloquent\SpatialTrait;
53
use Illuminate\Database\Eloquent\Model;
64

tests/Feature/SpatialTest.php

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?php
2-
namespace Grimzy\LaravelSpatial\Tests\Feature;
3-
42
use Grimzy\LaravelSpatial\SpatialServiceProvider;
5-
use Grimzy\LaravelSpatial\Tests\Feature\Models\GeometryModel;
63
use Grimzy\LaravelSpatial\Types\Point;
74
use Illuminate\Filesystem\Filesystem;
85
use Illuminate\Foundation\Testing\TestCase;
@@ -21,7 +18,7 @@ public function createApplication()
2118

2219
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
2320

24-
$app['config']->set('database.default','mysql');
21+
$app['config']->set('database.default', 'mysql');
2522
$app['config']->set('database.connections.mysql.host', '172.17.0.2');
2623
$app['config']->set('database.connections.mysql.database', 'db_test');
2724
$app['config']->set('database.connections.mysql.username', 'test_user');
@@ -53,40 +50,31 @@ public function tearDown()
5350
parent::tearDown();
5451
}
5552

56-
private function onMigrations(\Closure $closure) {
53+
private function onMigrations(\Closure $closure)
54+
{
5755
$fileSystem = new Filesystem();
58-
$classFinder = new ClassFinder();
56+
$classFinder = new Tools\ClassFinder();
5957

60-
foreach($fileSystem->files(__DIR__ . "/Migrations") as $file)
61-
{
58+
foreach ($fileSystem->files(__DIR__ . "/Migrations") as $file) {
6259
$fileSystem->requireOnce($file);
6360
$migrationClass = $classFinder->findClass($file);
6461

6562
$closure($migrationClass);
6663
}
6764
}
6865

69-
/**
70-
* A basic test example.
71-
*
72-
* @return void
73-
*/
74-
public function testBasicTest()
75-
{
76-
$response = $this->get('/');
77-
$response->assertStatus(200);
78-
}
79-
80-
// TODO: Test with a model missing $spatialFields to expect SpecialFieldNotDefinedException
66+
// TODO: Test with a model missing $spatialFields to expect SpatialFieldNotDefinedException
8167

82-
public function testInsert() {
68+
public function testInsert()
69+
{
8370
$geo = new GeometryModel();
8471
$geo->location = new Point(1, 2);
8572
$geo->save();
8673
$this->assertDatabaseHas('geometry', ['id' => $geo->id]);
8774
}
8875

89-
public function testUpdate() {
76+
public function testUpdate()
77+
{
9078
$geo = new GeometryModel();
9179
$geo->location = new Point(1, 2);
9280
$geo->save();
@@ -99,7 +87,7 @@ public function testUpdate() {
9987

10088
$all = GeometryModel::all();
10189
$this->assertCount(1, $all);
102-
90+
10391
$updated = $all->first();
10492
$this->assertInstanceOf(Point::class, $updated->location);
10593
$this->assertEquals(2, $updated->location->getLat());
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace Grimzy\LaravelSpatial\Tests\Feature;
2+
namespace Tools;
33

44
use Symfony\Component\Finder\Finder;
55

0 commit comments

Comments
 (0)