@@ 37-46 (lines=10) @@ | ||
34 | $this->assertCount(0, $data); |
|
35 | } |
|
36 | ||
37 | public function testGetDocumentWithIdentifierOnlyWithFields() |
|
38 | { |
|
39 | $transformer = $this->getTransformer(); |
|
40 | $document = $transformer->transform(new POPO(), array('name' => array())); |
|
41 | $data = $document->getData(); |
|
42 | ||
43 | $this->assertInstanceOf('Elastica\Document', $document); |
|
44 | $this->assertEquals(123, $document->getId()); |
|
45 | $this->assertCount(0, $data); |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * @return ModelToElasticaIdentifierTransformer |
@@ 188-197 (lines=10) @@ | ||
185 | $this->assertEquals('someName', $document->get('realName')); |
|
186 | } |
|
187 | ||
188 | public function testThatCanTransformObject() |
|
189 | { |
|
190 | $transformer = $this->getTransformer(); |
|
191 | $document = $transformer->transform(new POPO(), array('name' => array())); |
|
192 | $data = $document->getData(); |
|
193 | ||
194 | $this->assertInstanceOf('Elastica\Document', $document); |
|
195 | $this->assertEquals(123, $document->getId()); |
|
196 | $this->assertEquals('someName', $data['name']); |
|
197 | } |
|
198 | ||
199 | public function testThatCanTransformObjectWithCorrectTypes() |
|
200 | { |