diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-09 09:27:23 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-09 09:27:23 +0200 |
commit | 6fa7d6e4db1a953aa87b47b74128465c7957ebf9 (patch) | |
tree | fa5d2dcf45388d7968f03e96ab3ec6fa4ea6a112 /tests/unit/controller/EntityApiSerializerTest.php | |
parent | 8462bed7820cecc23a0e0d64aa50db7be92272d9 (diff) |
more code coverage
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 |