Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Laravel upgrade 5.8 #760

Closed
wants to merge 10 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/node_modules
/public/hot
/public/storage
/public/modules/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, again when we publish module, it just copied file from the module assets to public, we dont need I guess. Take a final call and I will remove it if there is intention to copy assets from modules to public.

/storage/*.key
/vendor
Homestead.json
Expand Down
9 changes: 9 additions & 0 deletions Modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Activity/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't commit this file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will remove this and modified compose.json before committing finally because these are our internal companies module. I will adjust it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah no worries, I guess as much 😄
For your ease, it might be easier to have a separate asgardcms installation only for the contributions.
That way you don't risk mixing both together by accident.

Contact/
CourierTracking/
Faq/
Location/
Rarv/
StationaryPrint/
Task/
Transaction/
4 changes: 2 additions & 2 deletions Modules/Core/Tests/Asset/AsgardAssetManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class AsgardAssetManagerTest extends BaseTestCase
*/
private $assetManager;

public function setUp()
protected function setUp():void
{
parent::__construct();
parent::setUp();
$this->assetManager = new AsgardAssetManager();
}

Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Tests/Asset/AsgardAssetPipelineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class AsgardAssetPipelineTest extends BaseTestCase
/**
*
*/
public function setUp()
protected function setUp():void
{
parent::__construct();
$this->refreshApplication();
parent::setUp();

$this->assetPipeline = new AsgardAssetPipeline($this->app['Modules\Core\Foundation\Asset\Manager\AssetManager']);
$this->assetManager = $this->app['Modules\Core\Foundation\Asset\Manager\AssetManager'];
}
Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Tests/Asset/AssetFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class AssetFactoryTest extends BaseTestCase
*/
private $assetFactory;

public function setUp()
protected function setUp():void
{
parent::__construct();
$this->refreshApplication();
parent::setUp();

$this->assetFactory = app(AssetTypeFactory::class);
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract class BaseTestCase extends TestCase
{
protected $app;

public function setUp()
protected function setUp():void
{
parent::setUp();
$this->refreshApplication();
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Tests/TestBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

abstract class TestBrowserTest extends BaseTestCase
{
public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Tests/Theme/ThemeManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ThemeManagerTest extends BaseTestCase
/**
*
*/
public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Tests/Theme/ThemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ThemeTest extends BaseTestCase
*/
protected $theme;

public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
10 changes: 5 additions & 5 deletions Modules/Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
"require": {
"php": "^7.1.3",
"composer/installers": "~1.0",
"nwidart/laravel-modules": "^4.0",
"laravelcollective/html": "5.7.*",
"nwidart/laravel-modules": "^5.0",
"laravelcollective/html": "5.8.*",
"laracasts/presenter": "~0.2",
"dimsav/laravel-translatable": "~9.0",
"mcamara/laravel-localization": "~1.3",
"dimsav/laravel-translatable": "~10.0",
"mcamara/laravel-localization": "~1.5",
"floatingpoint/stylist": "~0.5",
"maatwebsite/laravel-sidebar": "~2.1",
"yajra/laravel-datatables-oracle": "~8.0",
"yajra/laravel-datatables-oracle": "~9.0",
"tightenco/ziggy": "~0.4"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions Modules/Media/Tests/EloquentFileRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class EloquentFileRepositoryTest extends MediaTestCase
*/
private $file;

public function setUp()
protected function setUp():void
{
parent::setUp();

Expand All @@ -32,7 +32,7 @@ public function setUp()
$this->app['config']->set('asgard.media.config.files-path', '/assets/media/');
}

public function tearDown()
protected function tearDown():void
{
if ($this->app['files']->isDirectory(public_path('assets')) === true) {
$this->app['files']->deleteDirectory(public_path('assets'));
Expand Down
4 changes: 2 additions & 2 deletions Modules/Media/Tests/EloquentFolderRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class EloquentFolderRepositoryTest extends MediaTestCase
*/
private $folder;

public function setUp()
protected function setUp():void
{
parent::setUp();

Expand All @@ -30,7 +30,7 @@ public function setUp()
$this->app['config']->set('asgard.media.config.files-path', '/assets/media/');
}

public function tearDown()
protected function tearDown():void
{
if ($this->app['files']->isDirectory(public_path('assets')) === true) {
$this->app['files']->deleteDirectory(public_path('assets'));
Expand Down
4 changes: 2 additions & 2 deletions Modules/Media/Tests/FileMoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class FileMoverTest extends MediaTestCase
*/
private $file;

protected function setUp()
protected function setUp():void
{
parent::setUp();

Expand All @@ -30,7 +30,7 @@ protected function setUp()
$this->app['config']->set('asgard.media.config.files-path', '/assets/media/');
}

public function tearDown()
protected function tearDown():void
{
if ($this->app['files']->isDirectory(public_path('assets')) === true) {
$this->app['files']->deleteDirectory(public_path('assets'));
Expand Down
4 changes: 2 additions & 2 deletions Modules/Media/Tests/FileServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ final class FileServiceTest extends MediaTestCase
*/
private $fileService;

public function setUp()
protected function setUp():void
{
parent::setUp();
$this->resetDatabase();
$this->fileService = app(FileService::class);
$this->app['config']->set('asgard.media.config.files-path', '/assets/media/');
}

public function tearDown()
protected function tearDown():void
{
if ($this->app['files']->isDirectory(public_path('assets')) === true) {
$this->app['files']->deleteDirectory(public_path('assets'));
Expand Down
2 changes: 1 addition & 1 deletion Modules/Media/Tests/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FileTest extends MediaTestCase
*/
private $file;

public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
4 changes: 2 additions & 2 deletions Modules/Media/Tests/FolderMoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class FolderMoverTest extends MediaTestCase
*/
private $folder;

protected function setUp()
protected function setUp():void
{
parent::setUp();

Expand All @@ -29,7 +29,7 @@ protected function setUp()
$this->app['config']->set('asgard.media.config.files-path', '/assets/media/');
}

public function tearDown()
protected function tearDown():void
{
if ($this->app['files']->isDirectory(public_path('assets')) === true) {
$this->app['files']->deleteDirectory(public_path('assets'));
Expand Down
4 changes: 2 additions & 2 deletions Modules/Media/Tests/ImagyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ImagyTest extends MediaTestCase
/**
*
*/
public function setUp()
protected function setUp():void
{
parent::setUp();
$this->app['config']->set('asgard.media.config.files-path', '/assets/media/');
Expand All @@ -47,7 +47,7 @@ public function setUp()
$this->finder->copy("{$this->mediaPath}google-map.png", "{$this->testbenchPublicPath}google-map.png");
}

public function tearDown()
protected function tearDown():void
{
$this->finder->delete("{$this->testbenchPublicPath}google-map.png");
$this->finder->delete("{$this->testbenchPublicPath}google-map_smallThumb.png");
Expand Down
4 changes: 2 additions & 2 deletions Modules/Media/Tests/MoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class MoverTest extends MediaTestCase
*/
private $mover;

public function setUp()
protected function setUp():void
{
parent::setUp();

Expand All @@ -24,7 +24,7 @@ public function setUp()
$this->app['config']->set('asgard.media.config.files-path', '/assets/media/');
}

public function tearDown()
protected function tearDown():void
{
if ($this->app['files']->isDirectory(public_path('assets')) === true) {
$this->app['files']->deleteDirectory(public_path('assets'));
Expand Down
2 changes: 1 addition & 1 deletion Modules/Media/Tests/ThumbnailsManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ThumbnailsManagerTest extends MediaTestCase
*/
private $thumbnailManager;

public function setUp()
protected function setUp():void
{
parent::setUp();
$this->thumbnailManager = app(ThumbnailManager::class);
Expand Down
2 changes: 1 addition & 1 deletion Modules/Menu/Services/MenuItemUriGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private function getPageSlug($id, $lang)
$translation = $page->translate($lang);

if ($translation === null) {
return $page->translate(config('app.fallback_locale'))->slug;
$translation = $page->translate(config('app.fallback_locale'));
}

return $translation->slug;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Menu/Tests/BaseMenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class BaseMenuTest extends TestCase
/**
*
*/
public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion Modules/Menu/Tests/EloquentMenuItemRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class EloquentMenuItemRepositoryTest extends BaseMenuTest
{
public function setUp()
protected function setUp():void
{
parent::setUp();
}
Expand Down
8 changes: 5 additions & 3 deletions Modules/Menu/Tests/MenuItemUriGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MenuItemUriGeneratorTest extends BaseMenuTest
*/
private $menuItemUriGenerator;

public function setUp()
protected function setUp():void
{
parent::setUp();
$this->page = app(PageRepository::class);
Expand Down Expand Up @@ -45,6 +45,7 @@ public function it_generates_uri_with_the_parents_slug()
{
Event::fake();
$this->page->create([
'id' => 1,
'is_home' => 1,
'template' => 'default',
'en' => [
Expand All @@ -54,12 +55,13 @@ public function it_generates_uri_with_the_parents_slug()
],
]);
$this->page->create([
'id' => 2,
'is_home' => 0,
'template' => 'default',
'en' => [
'title' => 'About',
'slug' => 'about',
'body' => 'My Page Body',
'slug' => 'about',
],
]);
$menu = $this->createMenu('main', 'Main');
Expand All @@ -76,7 +78,7 @@ public function it_generates_uri_with_the_parents_slug()
];
$this->menuItem->create($data);

self::assertEquals('awesome-page/about', $this->menuItemUriGenerator->generateUri(2, '1', 'en'));
self::assertEquals('awesome-page/about', $this->menuItemUriGenerator->generateUri(2, 1, 'en'));
}

/** @test */
Expand Down
2 changes: 1 addition & 1 deletion Modules/Menu/Tests/MenuOrdenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MenuOrdenerTest extends BaseMenuTest
*/
protected $menuOrdener;

public function setUp()
protected function setUp():void
{
parent::setUp();
$this->createMenu('main', 'Main Menu');
Expand Down
6 changes: 3 additions & 3 deletions Modules/Menu/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"require": {
"php": "^7.1.3",
"composer/installers": "~1.0",
"nwidart/laravel-menus": "^3.0",
"nwidart/laravel-menus": "^4.0",
"typicms/nestablecollection": "1.1.12"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.6.*",
"phpunit/phpunit": "~7.5",
"orchestra/testbench": "3.8.*",
"fzaninotto/faker": "1.4.0",
"doctrine/dbal": "~2.5",
"idavoll/page-module": "4.0.x-dev"
Expand Down
2 changes: 1 addition & 1 deletion Modules/Page/Tests/BasePageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class BasePageTest extends TestCase
*/
protected $page;

public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion Modules/Setting/Tests/BaseSettingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class BaseSettingTest extends TestCase
*/
protected $settingRepository;

public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion Modules/Setting/Tests/EloquentSettingRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class EloquentSettingRepositoryTest extends BaseSettingTest
{
public function setUp()
protected function setUp():void
{
parent::setUp();
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Setting/Tests/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SettingsTest extends BaseSettingTest
*/
protected $setting;

public function setUp()
protected function setUp():void
{
parent::setUp();
$this->setting = app('Modules\Setting\Support\Settings');
Expand Down
2 changes: 1 addition & 1 deletion Modules/Tag/Tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

abstract class BaseTestCase extends TestCase
{
public function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
Loading