diff --git a/.travis.yml b/.travis.yml index 676fbc6..8887a0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.5 - 5.6 - 7.0 diff --git a/composer.json b/composer.json index 19f3d1c..420d2a4 100644 --- a/composer.json +++ b/composer.json @@ -17,15 +17,14 @@ } ], "require": { - "illuminate/support": "~5.1", - "illuminate/database": "5.1.*|5.2.*", - "php" : "~5.5|~7.0" + "illuminate/database": "5.3.*", + "php" : ">=5.6.4" }, "require-dev": { "fzaninotto/faker": "~1.4", "phpunit/phpunit" : "4.*", "mockery/mockery": "~0.9.0", - "orchestra/testbench": "~3.0" + "orchestra/testbench": "~3.3" }, "autoload": { "psr-4": { diff --git a/database/migrations/0000_00_00_000000_create_comments_table.php b/database/migrations/0000_00_00_000000_create_comments_table.php index b213881..f27f5b4 100644 --- a/database/migrations/0000_00_00_000000_create_comments_table.php +++ b/database/migrations/0000_00_00_000000_create_comments_table.php @@ -9,7 +9,7 @@ class CreateCommentsTable extends Migration public function up() { - Schema::create('comments', function ($table) { + Schema::create('comments', function (Blueprint $table) { $table->increments('id'); $table->integer('commentable_id')->nullable(); $table->string('commentable_type')->nullable(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 97b74d5..d7e1d68 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,19 +15,10 @@ public function setUp() { parent::setUp(); - $this->artisan('migrate', [ - '--database' => 'testbench', + $this->loadMigrationsFrom([ + '--database' => 'testing', '--realpath' => realpath(__DIR__ . '/resources/database/migrations'), ]); - - $this->artisan('migrate', [ - '--database' => 'testbench', - '--realpath' => realpath(__DIR__ . '/../database/migrations'), - ]); - - $this->beforeApplicationDestroyed(function () { - $this->artisan('migrate:rollback'); - }); } /** @@ -36,8 +27,8 @@ public function setUp() */ protected function getEnvironmentSetUp($app) { - $app['config']->set('database.default', 'testbench'); - $app['config']->set('database.connections.testbench', [ + $app['config']->set('database.default', 'testing'); + $app['config']->set('database.connections.testing', [ 'driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '', diff --git a/tests/resources/database/migrations/0000_00_00_000000_comments.php b/tests/resources/database/migrations/0000_00_00_000000_comments.php new file mode 100644 index 0000000..7e19c61 --- /dev/null +++ b/tests/resources/database/migrations/0000_00_00_000000_comments.php @@ -0,0 +1,27 @@ +increments('id'); + $table->integer('commentable_id')->nullable(); + $table->string('commentable_type')->nullable(); + $table->integer('commented_id')->nullable(); + $table->string('commented_type')->nullable(); + $table->longText('comment'); + $table->boolean('approved')->default(true); + $table->double('rate', 15, 8)->nullable(); + $table->timestamps(); + }); + } + + public function down() + { + Schema::drop('comments'); + } + +} \ No newline at end of file