From 9876f90198aec20c24d5061b7949a8d34fbaafbd Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Sun, 27 Oct 2024 19:43:50 -0600 Subject: [PATCH] Moved Serializers assets to Assets dir --- tests/Assets/Serializers/ArrayableEntity.php | 31 +++++++++++++++++++ tests/Assets/Serializers/JsonableEntity.php | 31 +++++++++++++++++++ .../Serializers/ArraySerializerTest.php | 28 +---------------- .../Serializers/JsonSerializerTest.php | 28 +---------------- 4 files changed, 64 insertions(+), 54 deletions(-) create mode 100644 tests/Assets/Serializers/ArrayableEntity.php create mode 100644 tests/Assets/Serializers/JsonableEntity.php diff --git a/tests/Assets/Serializers/ArrayableEntity.php b/tests/Assets/Serializers/ArrayableEntity.php new file mode 100644 index 00000000..805971d9 --- /dev/null +++ b/tests/Assets/Serializers/ArrayableEntity.php @@ -0,0 +1,31 @@ +id; + } + + public function getName() + { + return $this->name; + } + + public function getList() + { + return $this->list; + } +} diff --git a/tests/Assets/Serializers/JsonableEntity.php b/tests/Assets/Serializers/JsonableEntity.php new file mode 100644 index 00000000..6a04415b --- /dev/null +++ b/tests/Assets/Serializers/JsonableEntity.php @@ -0,0 +1,31 @@ +id; + } + + public function getName() + { + return $this->name; + } + + public function getNumeric() + { + return $this->numeric; + } +} diff --git a/tests/Feature/Serializers/ArraySerializerTest.php b/tests/Feature/Serializers/ArraySerializerTest.php index f2fe45cc..2ea03491 100644 --- a/tests/Feature/Serializers/ArraySerializerTest.php +++ b/tests/Feature/Serializers/ArraySerializerTest.php @@ -2,8 +2,8 @@ namespace LaravelDoctrineTest\ORM\Feature\Serializers; -use LaravelDoctrine\ORM\Serializers\Arrayable; use LaravelDoctrine\ORM\Serializers\ArraySerializer; +use LaravelDoctrineTest\ORM\Assets\Serializers\ArrayableEntity; use LaravelDoctrineTest\ORM\TestCase; class ArraySerializerTest extends TestCase @@ -35,29 +35,3 @@ public function test_can_serialize_to_array() ], $array); } } - -class ArrayableEntity -{ - use Arrayable; - - protected $id = 'IDVALUE'; - - protected $name = 'NAMEVALUE'; - - protected $list = ['item1', 'item2']; - - public function getId() - { - return $this->id; - } - - public function getName() - { - return $this->name; - } - - public function getList() - { - return $this->list; - } -} diff --git a/tests/Feature/Serializers/JsonSerializerTest.php b/tests/Feature/Serializers/JsonSerializerTest.php index 5098fe2f..7970758f 100644 --- a/tests/Feature/Serializers/JsonSerializerTest.php +++ b/tests/Feature/Serializers/JsonSerializerTest.php @@ -2,8 +2,8 @@ namespace LaravelDoctrineTest\ORM\Feature\Serializers; -use LaravelDoctrine\ORM\Serializers\Jsonable; use LaravelDoctrine\ORM\Serializers\JsonSerializer; +use LaravelDoctrineTest\ORM\Assets\Serializers\JsonableEntity; use LaravelDoctrineTest\ORM\TestCase; class JsonSerializerTest extends TestCase @@ -41,29 +41,3 @@ public function test_can_serialize_to_json_with_numeric_check() $this->assertEquals('{"id":"IDVALUE","name":"NAMEVALUE","numeric":1}', $json); } } - -class JsonableEntity -{ - use Jsonable; - - protected $id = 'IDVALUE'; - - protected $name = 'NAMEVALUE'; - - protected $numeric = "1"; - - public function getId() - { - return $this->id; - } - - public function getName() - { - return $this->name; - } - - public function getNumeric() - { - return $this->numeric; - } -}