| @@ 10-26 (lines=17) @@ | ||
| 7 | ||
| 8 | class DoctrineWriterTest extends \PHPUnit_Framework_TestCase |
|
| 9 | { |
|
| 10 | public function testWriteItem() |
|
| 11 | { |
|
| 12 | $em = $this->getEntityManager(); |
|
| 13 | ||
| 14 | $em->expects($this->once()) |
|
| 15 | ->method('persist'); |
|
| 16 | ||
| 17 | $writer = new DoctrineWriter($em, 'DdeboerPort:TestEntity'); |
|
| 18 | ||
| 19 | $association = new TestEntity(); |
|
| 20 | $item = array( |
|
| 21 | 'firstProperty' => 'some value', |
|
| 22 | 'secondProperty' => 'some other value', |
|
| 23 | 'firstAssociation'=> $association |
|
| 24 | ); |
|
| 25 | $writer->writeItem($item); |
|
| 26 | } |
|
| 27 | ||
| 28 | public function testWriteItemMongodb() |
|
| 29 | { |
|
| @@ 28-45 (lines=18) @@ | ||
| 25 | $writer->writeItem($item); |
|
| 26 | } |
|
| 27 | ||
| 28 | public function testWriteItemMongodb() |
|
| 29 | { |
|
| 30 | $em = $this->getMongoDocumentManager(); |
|
| 31 | ||
| 32 | $em->expects($this->once()) |
|
| 33 | ->method('persist'); |
|
| 34 | ||
| 35 | $writer = new DoctrineWriter($em, 'DdeboerPort:TestEntity'); |
|
| 36 | ||
| 37 | $association = new TestEntity(); |
|
| 38 | $item = array( |
|
| 39 | 'firstProperty' => 'some value', |
|
| 40 | 'secondProperty' => 'some other value', |
|
| 41 | 'firstAssociation'=> $association |
|
| 42 | ); |
|
| 43 | $writer->prepare(); |
|
| 44 | $writer->writeItem($item); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function testUnsupportedDatabaseTypeException() |
|
| 48 | { |
|