Skip to content

Commit

Permalink
Remove Faker dependency to handle SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
bbs-smuller committed Feb 13, 2018
1 parent 1fd566e commit 6a118ce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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 @@ -40,6 +37,7 @@ public function testGetAllColumnsNames()
list($data, $model) = $this->addContent();

$columns = $model->getAllColumnsNames();

foreach ($data as $field => $value) {
$this->assertContains($field, $columns);
}
Expand Down Expand Up @@ -79,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 @@ -96,12 +95,13 @@ public function testScopeSearchWithResult()
$this->assertEquals($data['libelle'],$result->libelle);
}


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

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

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

0 comments on commit 6a118ce

Please sign in to comment.