Browse Source

Merge pull request #11 from nafiesl/laravel_7_upgrade

Laravel 7 upgrade
pull/12/head
Nafies Luthfi 5 years ago
committed by GitHub
parent
commit
c4c2461d78
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/Exceptions/Handler.php
  2. 11
      composer.json
  3. 3250
      composer.lock
  4. 21
      tests/Feature/Api/OutletListingTest.php
  5. 8
      tests/Unit/Models/OutletTest.php

10
app/Exceptions/Handler.php

@ -2,8 +2,8 @@
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
@ -29,10 +29,10 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* @param \Exception $exception
* @param \Throwable $exception
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);
}
@ -41,10 +41,10 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Throwable $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}

11
composer.json

@ -5,10 +5,11 @@
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"php": "^7.2.5",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0",
"laravel/tinker": "^1.0"
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.5"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
@ -16,8 +17,8 @@
"fzaninotto/faker": "^1.4",
"luthfi/simple-crud-generator": "^1.2",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.5"
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"autoload": {
"classmap": [

3250
composer.lock
File diff suppressed because it is too large
View File

21
tests/Feature/Api/OutletListingTest.php

@ -3,8 +3,8 @@
namespace Tests\Feature\Api;
use App\Outlet;
use Tests\BrowserKitTest as TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\BrowserKitTest as TestCase;
class OutletListingTest extends TestCase
{
@ -17,21 +17,28 @@ class OutletListingTest extends TestCase
$this->getJson(route('api.outlets.index'));
$this->seeJsonSubset([
$this->seeJsonContains([
'type' => 'FeatureCollection',
'features' => [
[
'type' => 'Feature',
'properties' => [
'name' => $outlet->name,
'address' => $outlet->address,
'coordinate' => $outlet->coordinate,
'name' => $outlet->name,
'address' => $outlet->address,
'coordinate' => $outlet->coordinate,
'latitude' => (string) $outlet->latitude,
'longitude' => (string) $outlet->longitude,
'map_popup_content' => $outlet->map_popup_content,
'creator_id' => (string) $outlet->creator_id,
'id' => $outlet->id,
'created_at' => $outlet->created_at,
'updated_at' => $outlet->updated_at,
],
'geometry' => [
'type' => 'Point',
'coordinates' => [
$outlet->longitude,
$outlet->latitude,
(string) $outlet->longitude,
(string) $outlet->latitude,
],
],
],

8
tests/Unit/Models/OutletTest.php

@ -2,14 +2,14 @@
namespace Tests\Unit\Models;
use App\User;
use App\Outlet;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\BrowserKitTest as TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class OutletTest extends TestCase
{
use DatabaseMigrations;
use RefreshDatabase;
/** @test */
public function an_outlet_has_name_link_attribute()
@ -52,7 +52,7 @@ class OutletTest extends TestCase
/** @test */
public function an_outlet_has_map_popup_content_attribute()
{
$outlet = factory(Outlet::class)->make(['lat' => '-3.333333', 'long' => '114.583333']);
$outlet = factory(Outlet::class)->create(['latitude' => '-3.333333', 'longitude' => '114.583333']);
$mapPopupContent = '';
$mapPopupContent .= '<div class="my-2"><strong>'.__('outlet.name').':</strong><br>'.$outlet->name_link.'</div>';

Loading…
Cancel
Save