Commit f3dadd96 authored by Viral Solani's avatar Viral Solani

Upgrade to laravel 5.8

parent edef02f2
......@@ -145,3 +145,7 @@
127.0.0.1 - - [07/Mar/2019:18:15:03 +0530] "GET /login HTTP/1.1" 200 12126 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
127.0.0.1 - - [07/Mar/2019:18:15:07 +0530] "POST /login HTTP/1.1" 302 1459 "http://laraveladminpanel.local/login" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
127.0.0.1 - - [07/Mar/2019:18:15:07 +0530] "GET /admin/dashboard HTTP/1.1" 200 21420 "http://laraveladminpanel.local/login" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
127.0.0.1 - - [07/Mar/2019:19:47:51 +0530] "GET /admin/dashboard HTTP/1.1" 302 1697 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
127.0.0.1 - - [07/Mar/2019:19:47:53 +0530] "GET /login HTTP/1.1" 200 2671 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
127.0.0.1 - - [07/Mar/2019:19:48:00 +0530] "POST /login HTTP/1.1" 302 1470 "http://laraveladminpanel.local/login" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
127.0.0.1 - - [07/Mar/2019:19:48:00 +0530] "GET /admin/dashboard HTTP/1.1" 200 3839 "http://laraveladminpanel.local/login" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
......@@ -58,20 +58,6 @@ class AppServiceProvider extends ServiceProvider
* Sets third party service providers that are only needed on local/testing environments
*/
if ($this->app->environment() != 'production') {
/**
* Loader for registering facades.
*/
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
/*
* Load third party local providers
*/
$this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
/*
* Load third party local aliases
*/
$loader->alias('Debugbar', \Barryvdh\Debugbar\Facade::class);
}
}
}
This diff is collapsed.
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
......@@ -147,7 +146,6 @@ return [
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
......@@ -193,7 +191,7 @@ return [
App\Providers\AccessServiceProvider::class,
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\BladeServiceProvider::class,
//App\Providers\BladeServiceProvider::class,
//App\Providers\BroadcastServiceProvider::class,
App\Providers\ComposerServiceProvider::class,
App\Providers\EventServiceProvider::class,
......@@ -216,7 +214,6 @@ return [
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
......@@ -263,7 +260,5 @@ return [
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class,
//'Datatables' => Yajra\DataTables\Facades\DataTables::class
],
];
......@@ -50,7 +50,7 @@ abstract class BrowserKitTestCase extends BaseTestCase
*/
protected $userRole;
public function setUp()
public function setUp(): void
{
parent::setUp();
......@@ -76,7 +76,7 @@ abstract class BrowserKitTestCase extends BaseTestCase
$this->userRole = Role::find(3);
}
public function tearDown()
public function tearDown(): void
{
$this->beforeApplicationDestroyed(function () {
DB::disconnect();
......
......@@ -13,19 +13,17 @@ class PageTest extends TestCase
public $headers = '';
public $user = '';
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->user = User::find(1);
$this->token = JWTAuth::fromUser($this->user);
$this->headers = ['Authorization' => 'Bearer '.$this->token];
$this->headers = ['Authorization' => 'Bearer ' . $this->token];
}
/**
* A basic test example.
*
* @return void
*/
public function testExample()
{
......@@ -34,8 +32,6 @@ class PageTest extends TestCase
/**
* A basic test to get response form pages api.
*
* @return void
*/
/** @test */
......@@ -46,7 +42,7 @@ class PageTest extends TestCase
$response
->assertStatus(200)
->assertJsonStructure([
'data'=> [
'data' => [
[
'id',
'title',
......@@ -63,8 +59,6 @@ class PageTest extends TestCase
/**
* A basic test to get response form pages api.
*
* @return void
*/
/** @test */
......@@ -72,11 +66,11 @@ class PageTest extends TestCase
{
$page = create(Page::class);
$payload = [];
$response = $this->json('GET', '/api/v1/pages/'.$page->id, $payload, $this->headers);
$response = $this->json('GET', '/api/v1/pages/' . $page->id, $payload, $this->headers);
$response
->assertStatus(200)
->assertJson([
'data'=> [
'data' => [
'id' => $page->id,
'title' => $page->title,
'status_label' => $page->status_label,
......@@ -90,9 +84,6 @@ class PageTest extends TestCase
* Author: Indra Shastri
* Date:03-03-2018
* A basic test to update a page from api.
*
*
* @return void
*/
/** @test */
......@@ -113,11 +104,11 @@ class PageTest extends TestCase
$response->assertStatus(200);
$response->assertJson([
'data'=> [
'data' => [
'title' => $page->title,
'status_label' => $page->status_label,
'status' => ($page->isActive()) ? 'Active' : 'InActive',
'created_by' => ''.$this->user->id,
'created_by' => '' . $this->user->id,
],
]);
}
......@@ -126,8 +117,6 @@ class PageTest extends TestCase
* Author: Indra Shastri
* Date:03-03-2018
* A basic test to create a page from api.
*
* @return void
*/
/** @test */
......@@ -161,8 +150,6 @@ class PageTest extends TestCase
* Author: Indra Shastri
* Date:03-03-2018
* A basic test to create a page from api.
*
* @return void
*/
/** @test */
......@@ -170,10 +157,10 @@ class PageTest extends TestCase
{
$page = create(Page::class);
$payload = [];
$response = $this->json('DELETE', '/api/v1/pages/'.$page->id, $payload, $this->headers);
$response = $this->json('DELETE', '/api/v1/pages/' . $page->id, $payload, $this->headers);
$response->assertStatus(200)
->assertJson([
'message'=> 'The Page was successfully deleted.',
'message' => 'The Page was successfully deleted.',
]);
}
}
......@@ -16,7 +16,7 @@ class ManageBlogsTest extends TestCase
protected $categories;
protected $tags;
public function setUp()
public function setUp(): void
{
parent::setUp();
......@@ -142,7 +142,7 @@ class ManageBlogsTest extends TestCase
$stored_blog = Blog::find(2);
Storage::disk('public')->assertExists('img/blog/'.$stored_blog->featured_image);
Storage::disk('public')->assertExists('img/blog/' . $stored_blog->featured_image);
}
/** @test */
......@@ -227,7 +227,8 @@ class ManageBlogsTest extends TestCase
$catCategory = create(Blog::class, ['name' => 'Cat']);
$dogCategory = create(Blog::class, ['name' => 'Dog']);
$this->patch(route('admin.blogs.update', $dogCategory),
$this->patch(
route('admin.blogs.update', $dogCategory),
['name' => 'Cat']
)->assertSessionHasErrors('name');
}
......
......@@ -11,7 +11,7 @@ class ManageSettingsTest extends TestCase
{
protected $setting;
public function setUp()
public function setUp(): void
{
parent::setUp();
......@@ -38,7 +38,7 @@ class ManageSettingsTest extends TestCase
'logo' => UploadedFile::fake()->image('logo.jpg', 226, 48),
]);
Storage::disk('public')->assertExists('img/logo/'.$this->setting->logo);
Storage::disk('public')->assertExists('img/logo/' . $this->setting->logo);
}
/** @test */
......@@ -59,7 +59,7 @@ class ManageSettingsTest extends TestCase
'favicon' => UploadedFile::fake()->image('favicon.jpg', 16, 16),
]);
Storage::disk('public')->assertExists('img/favicon/'.$this->setting->favicon);
Storage::disk('public')->assertExists('img/favicon/' . $this->setting->favicon);
}
/** @test */
......
......@@ -54,7 +54,7 @@ abstract class TestCase extends BaseTestCase
/**
* Set up tests.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
......@@ -80,7 +80,7 @@ abstract class TestCase extends BaseTestCase
$this->userRole = Role::find(3);
}
public function tearDown()
public function tearDown(): void
{
$this->beforeApplicationDestroyed(function () {
DB::disconnect();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment