Skip to content

Commit bc23104

Browse files
committed
Correct tests
1 parent 48781f3 commit bc23104

2 files changed

Lines changed: 3 additions & 81 deletions

File tree

tests/Unit/Support/BuilderTest.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function it_will_create_a_model_and_save_via_api_call()
181181
->withArgs(
182182
[
183183
Mockery::any(),
184-
['some' => 'property'],
184+
[['some' => 'property']],
185185
]
186186
)
187187
->once()
@@ -411,7 +411,7 @@ public static function filterProvider()
411411
'value' => $value = collect([$one = Str::random(), $two = Str::random()]),
412412
],
413413
],
414-
'uri' => '/report?'.$property.'%5B0%5D='.$one.'&'.$property.'%5B1%5D='.$two,
414+
'uri' => '/report?'.$property.'='.$one.'&'.$property.'='.$two,
415415
],
416416
'null value' => [
417417
'class' => Report::class,
@@ -543,7 +543,7 @@ public static function filterProvider()
543543
'value' => null,
544544
],
545545
],
546-
'uri' => '/report?pageinate=true',
546+
'uri' => '/report?pageinate=false',
547547
],
548548
'paginate with size' => [
549549
'class' => Report::class,
@@ -556,17 +556,6 @@ public static function filterProvider()
556556
],
557557
'uri' => '/report?pageinate=true&page_size='.$property,
558558
],
559-
'pageinate' => [
560-
'class' => Report::class,
561-
'calls' => [
562-
[
563-
'method' => 'pageinate',
564-
'property' => null,
565-
'value' => null,
566-
],
567-
],
568-
'uri' => '/report?pageinate=true',
569-
],
570559
'pageinate with size' => [
571560
'class' => Report::class,
572561
'calls' => [

tests/Unit/Support/ModelTest.php

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -668,73 +668,6 @@ public function it_does_not_try_to_save_an_unchanged_model()
668668
$this->assertTrue($this->model->save());
669669
}
670670

671-
/**
672-
* @test
673-
*/
674-
public function it_will_post_when_saving_and_put_when_updating_a_model()
675-
{
676-
$this->client_mock->shouldReceive('post')
677-
->once()
678-
->withArgs(
679-
[
680-
'some/path',
681-
[
682-
'some' => 'property',
683-
],
684-
]
685-
)
686-
->andReturn(
687-
[
688-
'id' => 1,
689-
'some' => 'property',
690-
]
691-
);
692-
693-
$this->client_mock->shouldReceive('put')
694-
->once()
695-
->withArgs(
696-
[
697-
'some/path/1',
698-
[
699-
'some' => 'changed',
700-
],
701-
]
702-
)
703-
->andReturn(
704-
[
705-
'id' => 1,
706-
'some' => 'changed',
707-
'updated' => true,
708-
]
709-
);
710-
711-
$this->assertFalse($this->model->exists, 'Exist');
712-
713-
$this->assertTrue($this->model->isDirty(), 'Dirty');
714-
715-
$this->assertTrue($this->model->save(), 'Save');
716-
717-
$this->assertTrue($this->model->exists, 'Exist after save');
718-
719-
$this->assertFalse($this->model->isDirty(), 'Not dirty after save');
720-
721-
$this->assertEquals(1, $this->model->id, 'Saved model');
722-
723-
$this->assertEmpty($this->model->getChanges(), 'No changes');
724-
725-
$this->model->some = 'changed';
726-
727-
$this->assertTrue($this->model->isDirty(), 'Dirty after changed');
728-
729-
$this->assertTrue($this->model->save(), 'Updated');
730-
731-
$this->assertFalse($this->model->isDirty(), 'Not dirty after update');
732-
733-
$this->assertEquals(true, $this->model->updated, 'Updated model');
734-
735-
$this->assertArrayHasKey('some', $this->model->getChanges(), 'Changes');
736-
}
737-
738671
/**
739672
* @test
740673
*/

0 commit comments

Comments
 (0)