Skip to content

Commit

Permalink
✅ Increase code coverage and quality.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieutu committed Feb 14, 2019
1 parent 625e7fb commit d214cda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Helpers/JsonImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function importAttributes($attributes): JsonImportable
{
$attributes = array_only($attributes, $this->importable->getJsonImportableAttributes());

return $this->importable instanceof Model ? $object = $this->importable->create($attributes) : $this->importable;
return $this->importable instanceof Model ? $this->importable->create($attributes) : $this->importable;
}

protected function importRelations($object, $attributes)
Expand Down
7 changes: 7 additions & 0 deletions tests/JsonImporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ public function testImportFromArray()
$this->assertAllImportedInDatabase();
}

public function testImportFromArrayable()
{
Foo::importFromJson(collect($this->getImportArray()));

$this->assertAllImportedInDatabase();
}

public function testImportNullRelation()
{
$objects = $this->getImportArray();
Expand Down

0 comments on commit d214cda

Please sign in to comment.