| @@ 52-60 (lines=9) @@ | ||
| 49 | $this->assertNotContains("dob", $fieldsName); |
|
| 50 | } |
|
| 51 | ||
| 52 | public function testEntityPropertyType() { |
|
| 53 | $this->service->generateMarkupForEntity('Test\TestBundle\Model\Person'); |
|
| 54 | $fieldsType = array(); |
|
| 55 | foreach ($this->twigEngine->renderParameters['fields'] as $field) { |
|
| 56 | $fieldsType[$field['name']] = $field['type']; |
|
| 57 | } |
|
| 58 | $this->assertEquals("int", $fieldsType['id']); |
|
| 59 | $this->assertEquals("string", $fieldsType['firstName']); |
|
| 60 | } |
|
| 61 | ||
| 62 | public function testEntityPropertyValidation() { |
|
| 63 | $this->service->generateMarkupForEntity('Test\TestBundle\Model\Person'); |
|
| @@ 36-45 (lines=10) @@ | ||
| 33 | $this->assertContains("totalPrice", $fieldsName); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testDocumentPropertyType() { |
|
| 37 | $this->service->generateMarkupForEntity('Test\TestBundle\Document\Order'); |
|
| 38 | $fieldsType = array(); |
|
| 39 | foreach ($this->twigEngine->renderParameters['fields'] as $field) { |
|
| 40 | $fieldsType[$field['name']] = $field['type']; |
|
| 41 | } |
|
| 42 | $this->assertEquals("string", $fieldsType['id']); |
|
| 43 | $this->assertEquals("string", $fieldsType['name']); |
|
| 44 | $this->assertContains("float", $fieldsType['totalPrice']); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function testEmbeddedDocument() { |
|
| 48 | $this->service->generateMarkupForEntity('Test\TestBundle\Document\Order'); |
|