@@ 199-208 (lines=10) @@ | ||
196 | $this->assertSame('someName', $document->get('realName')); |
|
197 | } |
|
198 | ||
199 | public function testThatCanTransformObject() |
|
200 | { |
|
201 | $transformer = $this->getTransformer(); |
|
202 | $document = $transformer->transform(new POPO(), ['name' => []]); |
|
203 | $data = $document->getData(); |
|
204 | ||
205 | $this->assertInstanceOf(Document::class, $document); |
|
206 | $this->assertSame(123, $document->getId()); |
|
207 | $this->assertSame('someName', $data['name']); |
|
208 | } |
|
209 | ||
210 | public function testThatCanTransformObjectWithCorrectTypes() |
|
211 | { |
@@ 48-57 (lines=10) @@ | ||
45 | $this->assertCount(0, $data); |
|
46 | } |
|
47 | ||
48 | public function testGetDocumentWithIdentifierOnlyWithFields() |
|
49 | { |
|
50 | $transformer = $this->getTransformer(); |
|
51 | $document = $transformer->transform(new POPO(), ['name' => []]); |
|
52 | $data = $document->getData(); |
|
53 | ||
54 | $this->assertInstanceOf(Document::class, $document); |
|
55 | $this->assertSame(123, $document->getId()); |
|
56 | $this->assertCount(0, $data); |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * @return ModelToElasticaIdentifierTransformer |