diff options
Diffstat (limited to 'tests/unit/controller/EntityApiSerializerTest.php')
-rw-r--r-- | tests/unit/controller/EntityApiSerializerTest.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/unit/controller/EntityApiSerializerTest.php b/tests/unit/controller/EntityApiSerializerTest.php index 9e77421ce..80752889d 100644 --- a/tests/unit/controller/EntityApiSerializerTest.php +++ b/tests/unit/controller/EntityApiSerializerTest.php @@ -15,9 +15,14 @@ namespace OCA\News\Controller; use \OCP\AppFramework\Http\Response; +use \OCP\AppFramework\Db\Entity; use \OCA\News\Db\Item; +class TestEntity extends Entity { + +} + class EntityApiSerializerTest extends \PHPUnit_Framework_TestCase { @@ -81,7 +86,7 @@ class EntityApiSerializerTest extends \PHPUnit_Framework_TestCase { } - public function noEntityNoChange() { + public function testNoEntityNoChange() { $serializer = new EntityApiSerializer('items'); $in = [ @@ -96,4 +101,16 @@ class EntityApiSerializerTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(1, $result['test']); } + + public function testEntitiesNoChange() { + $serializer = new EntityApiSerializer('items'); + + $in = [ + 'items' => [new TestEntity()] + ]; + + $result = $serializer->serialize($in); + + $this->assertEquals($in, $result); + } }
\ No newline at end of file |