Skip to content

Commit

Permalink
Merge pull request #19 from bbs-smuller/laravel-5.5
Browse files Browse the repository at this point in the history
Setup for Laravel 5.5
  • Loading branch information
mfrancois authored Feb 13, 2018
2 parents 5dab40c + 6a118ce commit ca534d4
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 55 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.6
- 7.0
- 7.1

Expand All @@ -11,9 +10,9 @@ env:

matrix:
include:
- php: 5.6
- php: 7.0
env: setup=lowest
- php: 5.6
- php: 7.0
env: setup=stable
sudo: false

Expand All @@ -40,8 +39,6 @@ script:
fi
matrix:
allow_failures:
- php: 7.1
fast_finish: true

after_script:
Expand Down
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
],

"require": {
"php": ">=5.6.4",
"illuminate/support": "5.4.*",
"illuminate/database": "5.4.*",
"illuminate/translation": "5.4.*",
"distilleries/datatable-builder": "2.9.*",
"distilleries/form-builder": "2.9.*",
"distilleries/permission-util": "1.6.*",
"php": ">=7",
"illuminate/support": "5.5.*",
"illuminate/database": "5.5.*",
"illuminate/translation": "5.5.*",
"distilleries/datatable-builder": "2.10.*",
"distilleries/form-builder": "2.10.*",
"distilleries/permission-util": "1.7.*",
"forxer/Gravatar": "~1.2",
"maatwebsite/excel": "2.1.*"
},
"require-dev": {
"orchestra/database": "3.4.*",
"orchestra/testbench": "3.4.*",
"orchestra/testbench-browser-kit": "3.4.*",
"phpunit/phpunit": "~5.7",
"mockery/mockery": "0.9.*",
"orchestra/database": "3.5.*",
"orchestra/testbench": "3.5.*",
"orchestra/testbench-browser-kit": "3.5.*",
"phpunit/phpunit": "~6.0",
"mockery/mockery": "~1.0",
"fzaninotto/faker": "1.6.*"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions src/Distilleries/Expendable/Console/ComponentMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public function __construct(Filesystem $files, ComponentGenerator $formGenerator
$this->formGenerator = $formGenerator;
}

public function fire()
public function handle()
{
$this->initOptions();
parent::fire();
parent::handle();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function getChoiceModels()
'namespace' => '{{app}}',
],
[
'path' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR,
'path' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR,
'namespace' => 'Distilleries\\Expendable\\Models\\',
],
];
Expand Down
2 changes: 1 addition & 1 deletion tests/ExpendableTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function resolveApplication()
public function setUp()
{
parent::setUp();
$this->app['Illuminate\Contracts\Console\Kernel']->call('vendor:publish');
$this->app['Illuminate\Contracts\Console\Kernel']->call('vendor:publish', ['--all' => true]);
$this->artisan('migrate');

}
Expand Down
50 changes: 16 additions & 34 deletions tests/Models/BaseModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ class BaseModelTest extends ExpendableTestCase {

protected function addContent()
{

$faker = Faker\Factory::create();
$data = [
'libelle' => $faker->realText(20),
'iso' => $faker->iso8601,
'libelle' => 'English',
'iso' => Carbon\Carbon::now()->toIso8601String(),
'not_visible' => false,
'is_default' => false,
'status' => true

];


$result = \Distilleries\Expendable\Models\Language::create($data);
$result = \Distilleries\Expendable\Models\Language::find($result->id);

Expand All @@ -37,15 +34,12 @@ public function testGetChoice()

public function testGetAllColumnsNames()
{
$this->disableExceptionHandling();
list($data, $model) = $this->addContent();

try
{
$model->getAllColumnsNames();
} catch (Exception $error)
{
$this->assertEquals('Database driver not supported: sqlite', $error->getMessage());
$columns = $model->getAllColumnsNames();

foreach ($data as $field => $value) {
$this->assertContains($field, $columns);
}
}

Expand Down Expand Up @@ -83,6 +77,7 @@ public function testScopeBetweenUpdateWithResult()
public function testScopeBetweenUpdateWithNoResult()
{
list($data, $model) = $this->addContent();

$start = date('Y-m-d', time() - 172800);
$end = date('Y-m-d', time() - 86400);
$choice = \Distilleries\Expendable\Models\Language::betweenUpdate($start, $end)->get()->last();
Expand All @@ -92,34 +87,21 @@ public function testScopeBetweenUpdateWithNoResult()

public function testScopeSearchWithResult()
{
$this->disableExceptionHandling();
try
{
list($data, $model) = $this->addContent();
$result = \Distilleries\Expendable\Models\Language::search($data['libelle'])->get()->last();

$this->assertTrue(!empty($result));
$this->assertEquals($data['libelle'],$result->libelle);
} catch (Exception $error)
{
$this->assertEquals('Database driver not supported: sqlite', $error->getMessage());
}
list($data, $model) = $this->addContent();

$result = \Distilleries\Expendable\Models\Language::search($data['libelle'])->get()->last();

$this->assertTrue(!empty($result));
$this->assertEquals($data['libelle'],$result->libelle);
}


public function testScopeSearchWithNoResult()
{
$this->disableExceptionHandling();
try
{
list($data, $model) = $this->addContent();
$result = \Distilleries\Expendable\Models\Language::search(uniqid().uniqid().uniqid())->get()->last();
$this->assertTrue(empty($result));
} catch (Exception $error)
{
$this->assertEquals('Database driver not supported: sqlite', $error->getMessage());
}
list($data, $model) = $this->addContent();

$result = \Distilleries\Expendable\Models\Language::search(uniqid().uniqid().uniqid())->get()->last();

$this->assertTrue(empty($result));
}
}

0 comments on commit ca534d4

Please sign in to comment.