Skip to content

Commit

Permalink
refactor: move related classes to tests to test folder: Model, migrat…
Browse files Browse the repository at this point in the history
…ions, and constants
  • Loading branch information
WatheqAlshowaiter committed Aug 26, 2024
1 parent 4a536d6 commit 6663828
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"defects":{"RequiredFieldsTest::test_get_required_fields_for_parent_model":5,"RequiredFieldsTest::test_get_required_fields_in_order":5,"RequiredFieldsTest::test_get_required_fields_for_another_parent_model":5,"RequiredFieldsTest::test_get_required_fields_for_child_model":5},"times":{"RequiredFieldsTest::test_get_required_fields_for_parent_model":0.002,"RequiredFieldsTest::test_get_required_fields_in_order":0.008,"RequiredFieldsTest::test_get_required_fields_for_another_parent_model":0.005,"RequiredFieldsTest::test_get_required_fields_for_child_model":0.003,"RequiredFieldsTest::test_get_required_fields_for_mother_model_for_older_versions":0.114,"RequiredFieldsTest::test_get_required_fields_for_son_model_for_older_versions":0.006,"RequiredFieldsTest::test_get_required_fields_for_son_model":0.005,"RequiredFieldsTest::test_get_required_fields_for_mother_model":0.004,"RequiredFieldsTest::test_get_required_with_defaults_and_nullables_and_primary_key":0.005,"RequiredFieldsTest::test_get_required_with_defaults_and_primary_key":0.005,"RequiredFieldsTest::test_get_required_with_primary_key":0.004,"RequiredFieldsTest::test_get_required_with_nullables_and_primary_key_for_older_versions":0.004,"RequiredFieldsTest::test_get_required_fields_with_nullables":0.005,"RequiredFieldsTest::test_get_required_with_nullables_and_defaults":0.005,"RequiredFieldsTest::test_get_required_with_nullables_and_primary_key":0.006,"RequiredFieldsTest::test_get_required_fields_with_defaults":0.005,"RequiredFieldsTest::test_get_required_fields_with_nullables_for_older_versions":0.007,"RequiredFieldsTest::test_get_required_fields_for_father_model":0.004,"RequiredFieldsTest::test_get_required_fields_for_father_model_for_older_versions":0.004}}
{"version":1,"defects":{"RequiredFieldsTest::test_get_required_fields_for_parent_model":5,"RequiredFieldsTest::test_get_required_fields_in_order":5,"RequiredFieldsTest::test_get_required_fields_for_another_parent_model":5,"RequiredFieldsTest::test_get_required_fields_for_child_model":5},"times":{"RequiredFieldsTest::test_get_required_fields_for_parent_model":0.002,"RequiredFieldsTest::test_get_required_fields_in_order":0.005,"RequiredFieldsTest::test_get_required_fields_for_another_parent_model":0.005,"RequiredFieldsTest::test_get_required_fields_for_child_model":0.003,"RequiredFieldsTest::test_get_required_fields_for_mother_model_for_older_versions":0.004,"RequiredFieldsTest::test_get_required_fields_for_son_model_for_older_versions":0.004,"RequiredFieldsTest::test_get_required_fields_for_son_model":0.004,"RequiredFieldsTest::test_get_required_fields_for_mother_model":0.004,"RequiredFieldsTest::test_get_required_with_defaults_and_nullables_and_primary_key":0.004,"RequiredFieldsTest::test_get_required_with_defaults_and_primary_key":0.006,"RequiredFieldsTest::test_get_required_with_primary_key":0.004,"RequiredFieldsTest::test_get_required_with_nullables_and_primary_key_for_older_versions":0.004,"RequiredFieldsTest::test_get_required_fields_with_nullables":0.004,"RequiredFieldsTest::test_get_required_with_nullables_and_defaults":0.004,"RequiredFieldsTest::test_get_required_with_nullables_and_primary_key":0.005,"RequiredFieldsTest::test_get_required_fields_with_defaults":0.004,"RequiredFieldsTest::test_get_required_fields_with_nullables_for_older_versions":0.003,"RequiredFieldsTest::test_get_required_fields_for_father_model":0.004,"RequiredFieldsTest::test_get_required_fields_for_father_model_for_older_versions":0.054}}
2 changes: 1 addition & 1 deletion src/ModelRequiredFieldsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function boot()
{
// This migration works only in the package test
if ($this->app->runningInConsole() && $this->app->environment() === 'testing') {
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->loadMigrationsFrom(__DIR__.'/../tests/database/migrations');
}
}
}
2 changes: 1 addition & 1 deletion src/Constants.php → tests/Constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace WatheqAlshowaiter\ModelRequiredFields;
namespace WatheqAlshowaiter\ModelRequiredFields\Tests;

class Constants
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Father.php → tests/Models/Father.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace WatheqAlshowaiter\ModelRequiredFields\Models;
namespace WatheqAlshowaiter\ModelRequiredFields\Tests\Models;

use Illuminate\Database\Eloquent\Model;
use WatheqAlshowaiter\ModelRequiredFields\RequiredFields;
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Mother.php → tests/Models/Mother.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace WatheqAlshowaiter\ModelRequiredFields\Models;
namespace WatheqAlshowaiter\ModelRequiredFields\Tests\Models;

use Illuminate\Database\Eloquent\Model;
use WatheqAlshowaiter\ModelRequiredFields\RequiredFields;
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Son.php → tests/Models/Son.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace WatheqAlshowaiter\ModelRequiredFields\Models;
namespace WatheqAlshowaiter\ModelRequiredFields\Tests\Models;

use Illuminate\Database\Eloquent\Model;
use WatheqAlshowaiter\ModelRequiredFields\RequiredFields;
Expand Down
6 changes: 3 additions & 3 deletions tests/RequiredFieldsTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

use Illuminate\Foundation\Testing\RefreshDatabase;
use WatheqAlshowaiter\ModelRequiredFields\Models\Father;
use WatheqAlshowaiter\ModelRequiredFields\Models\Mother;
use WatheqAlshowaiter\ModelRequiredFields\Models\Son;
use WatheqAlshowaiter\ModelRequiredFields\Tests\Models\Father;
use WatheqAlshowaiter\ModelRequiredFields\Tests\Models\Mother;
use WatheqAlshowaiter\ModelRequiredFields\Tests\Models\Son;
use WatheqAlshowaiter\ModelRequiredFields\Tests\TestCase;

class RequiredFieldsTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Schema;
use WatheqAlshowaiter\ModelRequiredFields\Constants;
use WatheqAlshowaiter\ModelRequiredFields\Tests\Constants;

class CreateFathersTable extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use WatheqAlshowaiter\ModelRequiredFields\Constants;
use WatheqAlshowaiter\ModelRequiredFields\Tests\Constants;

class CreateMothersTable extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use WatheqAlshowaiter\ModelRequiredFields\Constants;
use WatheqAlshowaiter\ModelRequiredFields\Tests\Constants;

class CreateSonsTable extends Migration
{
Expand Down

0 comments on commit 6663828

Please sign in to comment.