From 5c9ae377f2613df71f0376b6b526171453f4339a Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Sun, 10 Jan 2021 09:21:14 +0000 Subject: [PATCH] wip --- packages/model/src/Model.php | 4 ++-- packages/rule/src/Rule.php | 4 ++-- tests/{SquireTest.php => ModelTest.php} | 18 ++++++++++++++--- tests/TestCase.php | 27 +++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 7 deletions(-) rename tests/{SquireTest.php => ModelTest.php} (75%) create mode 100644 tests/TestCase.php diff --git a/packages/model/src/Model.php b/packages/model/src/Model.php index 715b73e..53ddb26 100644 --- a/packages/model/src/Model.php +++ b/packages/model/src/Model.php @@ -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; diff --git a/packages/rule/src/Rule.php b/packages/rule/src/Rule.php index 095ea94..0276e87 100644 --- a/packages/rule/src/Rule.php +++ b/packages/rule/src/Rule.php @@ -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'; diff --git a/tests/SquireTest.php b/tests/ModelTest.php similarity index 75% rename from tests/SquireTest.php rename to tests/ModelTest.php index 47197f9..b37a4d8 100644 --- a/tests/SquireTest.php +++ b/tests/ModelTest.php @@ -1,13 +1,13 @@ 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 diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..0f99df3 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,27 @@ +