Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from actuallymab/laravel-5.3-support
Browse files Browse the repository at this point in the history
Laravel 5.3 support
  • Loading branch information
ShortlyMAB authored Oct 18, 2016
2 parents fe6f140 + dfd15d6 commit 0072628
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.5
- 5.6
- 7.0

Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
17 changes: 4 additions & 13 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}

/**
Expand All @@ -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' => '',
Expand Down
27 changes: 27 additions & 0 deletions tests/resources/database/migrations/0000_00_00_000000_comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/** actuallymab | 12.06.2016 - 02:00 */

class Comments extends \Illuminate\Database\Migrations\Migration
{

public function up()
{
Schema::create('comments', function ($table) {
$table->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');
}

}

0 comments on commit 0072628

Please sign in to comment.