diff --git a/app/Utilities/Info.php b/app/Utilities/Info.php index b6395a613..3f9e33534 100644 --- a/app/Utilities/Info.php +++ b/app/Utilities/Info.php @@ -37,12 +37,8 @@ class Info return phpversion(); } - public static function mysqlVersion() - { - if(\App::environment() === "testing") { - return DB::selectOne('select sqlite_version() as mversion')->mversion; - } - - return DB::selectOne('select version() as mversion')->mversion; - } + public static function mysqlVersion() + { + return DB::selectOne('select version() as mversion')->mversion; + } } \ No newline at end of file diff --git a/database/migrations/2017_12_09_000000_add_currency_columns.php b/database/migrations/2017_12_09_000000_add_currency_columns.php index 2abe73c14..e5f282112 100644 --- a/database/migrations/2017_12_09_000000_add_currency_columns.php +++ b/database/migrations/2017_12_09_000000_add_currency_columns.php @@ -26,21 +26,13 @@ class AddCurrencyColumns extends Migration * @return void */ public function down() - { - Schema::table('currencies', function ($table) { - $table->dropColumn('precision'); - }); + { Schema::table('currencies', function ($table) { + $table->dropColumn('precision'); $table->dropColumn('symbol'); - }); - Schema::table('currencies', function ($table) { $table->dropColumn('symbol_first'); - }); - Schema::table('currencies', function ($table) { $table->dropColumn('decimal_mark'); - }); - Schema::table('currencies', function ($table) { $table->dropColumn('thousands_separator'); }); - } + } } diff --git a/database/migrations/2018_04_23_000000_add_category_column_invoices_bills.php b/database/migrations/2018_04_23_000000_add_category_column_invoices_bills.php index ae68b8c30..dd8b4fca0 100644 --- a/database/migrations/2018_04_23_000000_add_category_column_invoices_bills.php +++ b/database/migrations/2018_04_23_000000_add_category_column_invoices_bills.php @@ -4,35 +4,35 @@ use Illuminate\Database\Migrations\Migration; class AddCategoryColumnInvoicesBills extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::table('invoices', function ($table) { - $table->integer('category_id')->nullable(); - }); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('invoices', function ($table) { + $table->integer('category_id'); + }); - Schema::table('bills', function ($table) { - $table->integer('category_id')->nullable(); - }); - } + Schema::table('bills', function ($table) { + $table->integer('category_id'); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('invoices', function ($table) { - $table->dropColumn('category_id'); - }); + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('invoices', function ($table) { + $table->dropColumn('category_id'); + }); - Schema::table('bills', function ($table) { - $table->dropColumn('category_id'); - }); - } + Schema::table('bills', function ($table) { + $table->dropColumn('category_id'); + }); + } } diff --git a/database/seeds/Accounts.php b/database/seeds/Accounts.php index d9a7c557d..85b17b48a 100644 --- a/database/seeds/Accounts.php +++ b/database/seeds/Accounts.php @@ -26,7 +26,7 @@ class Accounts extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); $rows = [ [ diff --git a/database/seeds/BillStatuses.php b/database/seeds/BillStatuses.php index c09600176..924fde7e7 100644 --- a/database/seeds/BillStatuses.php +++ b/database/seeds/BillStatuses.php @@ -26,7 +26,7 @@ class BillStatuses extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); $rows = [ [ diff --git a/database/seeds/Categories.php b/database/seeds/Categories.php index 99bd4edc7..06cd9e3e0 100644 --- a/database/seeds/Categories.php +++ b/database/seeds/Categories.php @@ -26,7 +26,7 @@ class Categories extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); $rows = [ [ diff --git a/database/seeds/Currencies.php b/database/seeds/Currencies.php index 33e7fff1e..47585760c 100644 --- a/database/seeds/Currencies.php +++ b/database/seeds/Currencies.php @@ -26,7 +26,7 @@ class Currencies extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); $rows = [ [ diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index c87ce601b..b4295ab87 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -11,7 +11,6 @@ class DatabaseSeeder extends Seeder */ public function run() { - $this->call(\Database\Seeds\TestCompany::class); - $this->call(CompanySeeder::class); + // } } diff --git a/database/seeds/InvoiceStatuses.php b/database/seeds/InvoiceStatuses.php index d2733f75c..28565f69f 100644 --- a/database/seeds/InvoiceStatuses.php +++ b/database/seeds/InvoiceStatuses.php @@ -26,7 +26,7 @@ class InvoiceStatuses extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); $rows = [ [ diff --git a/database/seeds/Modules.php b/database/seeds/Modules.php index f66588eb0..3ba6807e5 100644 --- a/database/seeds/Modules.php +++ b/database/seeds/Modules.php @@ -26,7 +26,7 @@ class Modules extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); Artisan::call('module:install', ['alias' => 'offlinepayment', 'company_id' => $company_id]); Artisan::call('module:install', ['alias' => 'paypalstandard', 'company_id' => $company_id]); diff --git a/database/seeds/Roles.php b/database/seeds/Roles.php index 56d4aec21..ae97b183f 100644 --- a/database/seeds/Roles.php +++ b/database/seeds/Roles.php @@ -10,10 +10,6 @@ use Illuminate\Database\Seeder; class Roles extends Seeder { - public function __construct() - { - } - /** * Run the database seeds. * diff --git a/database/seeds/Settings.php b/database/seeds/Settings.php index 46eb71c44..a71620022 100644 --- a/database/seeds/Settings.php +++ b/database/seeds/Settings.php @@ -25,7 +25,7 @@ class Settings extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); Setting::set([ 'general.date_format' => 'd M Y', diff --git a/database/seeds/Taxes.php b/database/seeds/Taxes.php index 52251f2be..ade781b62 100644 --- a/database/seeds/Taxes.php +++ b/database/seeds/Taxes.php @@ -26,7 +26,7 @@ class Taxes extends Seeder private function create() { - $company_id = Company::first()->id; + $company_id = $this->command->argument('company'); $rows = [ [ diff --git a/tests/TestCase.php b/tests/TestCase.php index ceb9b80ec..63c894417 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,6 +5,7 @@ namespace Tests; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; +use Illuminate\Support\Facades\Artisan; abstract class TestCase extends BaseTestCase { @@ -13,6 +14,7 @@ abstract class TestCase extends BaseTestCase protected function setUp() { parent::setUp(); - $this->artisan('db:seed'); + Artisan::call('db:seed', ['--class' => '\Database\Seeds\TestCompany', '--force' => true]); + Artisan::call('company:seed',['company' => 1]); } }