Completed
Push — develop ( 383c83...b85182 )
by
unknown
11s
created

JsonSerializerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testMongoHandling() 0 13 1
1
<?php
2
/**
3
 * test our jsonserializer extension
4
 */
5
6
namespace Graviton\ImportExportTest\Util;
7
8
use Graviton\ImportExport\Util\JsonSerializer;
9
10
/**
11
 * @author   List of contributors <https://github.com/libgraviton/import-export/graphs/contributors>
12
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
13
 * @link     http://swisscom.ch
14
 */
15
class JsonSerializerTest extends \PHPUnit_Framework_TestCase
16
{
17
18
    /**
19
     * see if mongoid/mongodate can be properly unserialized again..
20
     *
21
     * @return void
22
     */
23
    public function testMongoHandling()
24
    {
25
        $origClass = new \stdClass();
26
        $origClass->id = 'Class';
27
        $origClass->mongoId = new \MongoId('5a5e05679ca9b2108b5e2ac9');
28
        $origClass->mongoDate = new \MongoDate();
29
30
        $serializer = new JsonSerializer();
31
        $serialized = $serializer->serialize($origClass);
32
        $class = $serializer->unserialize($serialized);
33
34
        $this->assertEquals($origClass, $class);
35
    }
36
}
37