Update calls to missing function
This commit is contained in:
parent
60eb60013c
commit
5f9fe4a69b
45 changed files with 78 additions and 78 deletions
|
@ -52,7 +52,7 @@ class EggUpdateServiceTest extends TestCase
|
|||
*/
|
||||
public function testEggIsUpdatedWhenNoConfigFromIsProvided()
|
||||
{
|
||||
$this->repository->shouldReceive('withoutFresh->update')
|
||||
$this->repository->shouldReceive('withoutFreshModel->update')
|
||||
->with($this->model->id, ['test_field' => 'field_value'])->once()->andReturnNull();
|
||||
|
||||
$this->service->handle($this->model, ['test_field' => 'field_value']);
|
||||
|
@ -70,7 +70,7 @@ class EggUpdateServiceTest extends TestCase
|
|||
['id', '=', 1],
|
||||
])->once()->andReturn(1);
|
||||
|
||||
$this->repository->shouldReceive('withoutFresh->update')
|
||||
$this->repository->shouldReceive('withoutFreshModel->update')
|
||||
->with($this->model->id, ['config_from' => 1])->once()->andReturnNull();
|
||||
|
||||
$this->service->handle($this->model, ['config_from' => 1]);
|
||||
|
@ -102,7 +102,7 @@ class EggUpdateServiceTest extends TestCase
|
|||
public function testIntegerCanBePassedInPlaceOfModel()
|
||||
{
|
||||
$this->repository->shouldReceive('find')->with($this->model->id)->once()->andReturn($this->model);
|
||||
$this->repository->shouldReceive('withoutFresh->update')
|
||||
$this->repository->shouldReceive('withoutFreshModel->update')
|
||||
->with($this->model->id, ['test_field' => 'field_value'])->once()->andReturnNull();
|
||||
|
||||
$this->service->handle($this->model->id, ['test_field' => 'field_value']);
|
||||
|
|
|
@ -66,7 +66,7 @@ class InstallScriptServiceTest extends TestCase
|
|||
$this->data['copy_script_from'] = 1;
|
||||
|
||||
$this->repository->shouldReceive('isCopiableScript')->with(1, $this->model->nest_id)->once()->andReturn(true);
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, $this->data)->andReturnNull();
|
||||
|
||||
$this->service->handle($this->model, $this->data);
|
||||
|
@ -93,7 +93,7 @@ class InstallScriptServiceTest extends TestCase
|
|||
*/
|
||||
public function testUpdateWithoutNewCopyScriptFromAttribute()
|
||||
{
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, $this->data)->andReturnNull();
|
||||
|
||||
$this->service->handle($this->model, $this->data);
|
||||
|
@ -105,7 +105,7 @@ class InstallScriptServiceTest extends TestCase
|
|||
public function testFunctionAcceptsIntegerInPlaceOfModel()
|
||||
{
|
||||
$this->repository->shouldReceive('find')->with($this->model->id)->once()->andReturn($this->model);
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, $this->data)->andReturnNull();
|
||||
|
||||
$this->service->handle($this->model->id, $this->data);
|
||||
|
|
|
@ -81,7 +81,7 @@ class EggUpdateImporterServiceTest extends TestCase
|
|||
'name' => $egg->name,
|
||||
]), true, true)->once()->andReturn($egg);
|
||||
|
||||
$this->variableRepository->shouldReceive('withoutFresh->updateOrCreate')->with([
|
||||
$this->variableRepository->shouldReceive('withoutFreshModel->updateOrCreate')->with([
|
||||
'egg_id' => $egg->id,
|
||||
'env_variable' => $variable->env_variable,
|
||||
], collect($variable)->except(['egg_id', 'env_variable'])->toArray())->once()->andReturnNull();
|
||||
|
@ -121,7 +121,7 @@ class EggUpdateImporterServiceTest extends TestCase
|
|||
'name' => $egg->name,
|
||||
]), true, true)->once()->andReturn($egg);
|
||||
|
||||
$this->variableRepository->shouldReceive('withoutFresh->updateOrCreate')->with([
|
||||
$this->variableRepository->shouldReceive('withoutFreshModel->updateOrCreate')->with([
|
||||
'egg_id' => $egg->id,
|
||||
'env_variable' => $variable1->env_variable,
|
||||
], collect($variable1)->except(['egg_id', 'env_variable'])->toArray())->once()->andReturnNull();
|
||||
|
|
|
@ -45,7 +45,7 @@ class VariableUpdateServiceTest extends TestCase
|
|||
*/
|
||||
public function testVariableIsUpdatedWhenNoEnvironmentVariableIsPassed()
|
||||
{
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, [
|
||||
'user_viewable' => false,
|
||||
'user_editable' => false,
|
||||
|
@ -61,7 +61,7 @@ class VariableUpdateServiceTest extends TestCase
|
|||
public function testVariableIdCanBePassedInPlaceOfModel()
|
||||
{
|
||||
$this->repository->shouldReceive('find')->with($this->model->id)->once()->andReturn($this->model);
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, [
|
||||
'user_viewable' => false,
|
||||
'user_editable' => false,
|
||||
|
@ -83,7 +83,7 @@ class VariableUpdateServiceTest extends TestCase
|
|||
['id', '!=', $this->model->id],
|
||||
])->once()->andReturn(0);
|
||||
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, [
|
||||
'user_viewable' => false,
|
||||
'user_editable' => false,
|
||||
|
@ -101,7 +101,7 @@ class VariableUpdateServiceTest extends TestCase
|
|||
*/
|
||||
public function testNullOptionValueIsPassedAsArray()
|
||||
{
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, [
|
||||
'user_viewable' => false,
|
||||
'user_editable' => false,
|
||||
|
@ -123,7 +123,7 @@ class VariableUpdateServiceTest extends TestCase
|
|||
['id', '!=', $this->model->id],
|
||||
])->once()->andReturn(0);
|
||||
|
||||
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, [
|
||||
'user_viewable' => false,
|
||||
'user_editable' => false,
|
||||
|
|
Reference in a new issue