Skip to content

Commit

Permalink
Moved Serializers assets to Assets dir
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Oct 28, 2024
1 parent 52ecacd commit 9876f90
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 54 deletions.
31 changes: 31 additions & 0 deletions tests/Assets/Serializers/ArrayableEntity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace LaravelDoctrineTest\ORM\Assets\Serializers;

use LaravelDoctrine\ORM\Serializers\Arrayable;

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;
}
}
31 changes: 31 additions & 0 deletions tests/Assets/Serializers/JsonableEntity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace LaravelDoctrineTest\ORM\Assets\Serializers;

use LaravelDoctrine\ORM\Serializers\Jsonable;

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;
}
}
28 changes: 1 addition & 27 deletions tests/Feature/Serializers/ArraySerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
28 changes: 1 addition & 27 deletions tests/Feature/Serializers/JsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 9876f90

Please sign in to comment.