Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Jan 10, 2021
1 parent 47831bf commit 5c9ae37
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/model/src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Squire;

use Illuminate\Database\Eloquent\Model as EloquentModel;
use Illuminate\Database\Eloquent;
use Illuminate\Support\Str;
use Sushi\Sushi;

class Model extends EloquentModel
class Model extends Eloquent\Model
{
use Sushi;

Expand Down
4 changes: 2 additions & 2 deletions packages/rule/src/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Squire;

use Illuminate\Contracts\Validation\Rule as RuleContract;
use Illuminate\Contracts\Validation;
use Illuminate\Support\Facades\Validator;

class Rule implements RuleContract
class Rule implements Validation\Rule
{
protected $column = 'id';

Expand Down
18 changes: 15 additions & 3 deletions tests/SquireTest.php → tests/ModelTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Tests;
namespace Squire\Tests;

use Illuminate\Support\Facades\App;
use Orchestra\Testbench\TestCase;
use Squire\Model;
use Squire\Models;
use Squire\Repository;

class SquireTest extends TestCase
class ModelTest extends TestCase
{
/** @test */
public function basic_usage()
Expand Down Expand Up @@ -36,6 +36,18 @@ public function custom_column_map_and_schema()
$this->assertEquals(Baz::first()->new_foo, '1.0');
$this->assertEquals(Baz::first()->new_bob, '1');
}

/** @test */
public function models()
{
$this->assertIsObject(Models\Airline::first());
$this->assertIsObject(Models\Airport::first());
$this->assertIsObject(Models\Continent::first());
$this->assertIsObject(Models\Country::first());
$this->assertIsObject(Models\Currency::first());
$this->assertIsObject(Models\GbCounty::first());
$this->assertIsObject(Models\Region::first());
}
}

class Foo extends Model
Expand Down
27 changes: 27 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Squire\Tests;

class TestCase extends \Orchestra\Testbench\TestCase
{
protected function getPackageProviders($app): array
{
return [
\Squire\AirlinesServiceProvider::class,
\Squire\AirlinesEnServiceProvider::class,
\Squire\AirportsServiceProvider::class,
\Squire\AirportsEnServiceProvider::class,
\Squire\ContinentsServiceProvider::class,
\Squire\ContinentsEnServiceProvider::class,
\Squire\CountriesServiceProvider::class,
\Squire\CountriesEnServiceProvider::class,
\Squire\CurrenciesServiceProvider::class,
\Squire\CurrenciesEnServiceProvider::class,
\Squire\GbCountiesServiceProvider::class,
\Squire\GbCountiesEnServiceProvider::class,
\Squire\RegionsServiceProvider::class,
\Squire\RegionsEnServiceProvider::class,
\Squire\RepositoryServiceProvider::class,
];
}
}

0 comments on commit 5c9ae37

Please sign in to comment.