Skip to content

Commit

Permalink
Merge pull request #2 from bildvitta/feature/real-estate-development
Browse files Browse the repository at this point in the history
Observers testing mode fix
  • Loading branch information
michaelnakamura authored Mar 3, 2022
2 parents 3f8c312 + 0fdbe1d commit cb2fb78
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Observers/RealEstateDevelopment/ParameterObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
namespace Bildvitta\IssSupernova\Observers\RealEstateDevelopment;

use Bildvitta\IssSupernova\IssSupernova;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;

class ParameterObserver
{
public function created($parameter)
{
if (App::runningUnitTests()) {
return;
}

$parameter->loadMissing('realEstateDevelopment');
$data = $parameter->toArray();
$data['sync_to'] = 'sys';
Expand All @@ -25,6 +30,10 @@ public function created($parameter)

public function updated($parameter)
{
if (App::runningUnitTests()) {
return;
}

$parameter->loadMissing('realEstateDevelopment');
$data = $parameter->toArray();
$data['sync_to'] = 'sys';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
namespace Bildvitta\IssSupernova\Observers\RealEstateDevelopment;

use Bildvitta\IssSupernova\IssSupernova;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;

class RealEstateDevelopmentObserver
{
public function created($realEstateDeveloptment)
{
if (App::runningUnitTests()) {
return;
}

$data = $realEstateDeveloptment->toArray();
$data['sync_to'] = 'sys';

Expand All @@ -24,6 +29,10 @@ public function created($realEstateDeveloptment)

public function updated($realEstateDeveloptment)
{
if (App::runningUnitTests()) {
return;
}

$data = $realEstateDeveloptment->toArray();
$data['sync_to'] = 'sys';

Expand Down
9 changes: 9 additions & 0 deletions src/Observers/RealEstateDevelopment/TypologyObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
namespace Bildvitta\IssSupernova\Observers\RealEstateDevelopment;

use Bildvitta\IssSupernova\IssSupernova;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;

class TypologyObserver
{
public function created($parameter)
{
if (App::runningUnitTests()) {
return;
}

$parameter->loadMissing('realEstateDevelopment');
$data = $parameter->toArray();
$data['sync_to'] = 'sys';
Expand All @@ -25,6 +30,10 @@ public function created($parameter)

public function updated($parameter)
{
if (App::runningUnitTests()) {
return;
}

$parameter->loadMissing('realEstateDevelopment');
$data = $parameter->toArray();
$data['sync_to'] = 'sys';
Expand Down
9 changes: 9 additions & 0 deletions src/Observers/RealEstateDevelopment/UnitObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
namespace Bildvitta\IssSupernova\Observers\RealEstateDevelopment;

use Bildvitta\IssSupernova\IssSupernova;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;

class UnitObserver
{
public function created($parameter)
{
if (App::runningUnitTests()) {
return;
}

$parameter->loadMissing(
'realEstateDevelopment',
'typology',
Expand All @@ -32,6 +37,10 @@ public function created($parameter)

public function updated($parameter)
{
if (App::runningUnitTests()) {
return;
}

$parameter->loadMissing(
'realEstateDevelopment',
'typology',
Expand Down

0 comments on commit cb2fb78

Please sign in to comment.