| @@ 39-50 (lines=12) @@ | ||
| 36 | $this->assertEquals("d-m-y", $fieldsType['createdAt']); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function testEntityProperty() { |
|
| 40 | $this->service->generateMarkupForEntity('Test\TestBundle\Model\Person'); |
|
| 41 | $this->assertContains("Test.model.Person", $this->twigEngine->renderParameters['name']); |
|
| 42 | $fieldsName = array(); |
|
| 43 | foreach ($this->twigEngine->renderParameters['fields'] as $field) { |
|
| 44 | $fieldsName[] = $field['name']; |
|
| 45 | } |
|
| 46 | $this->assertContains("id", $fieldsName); |
|
| 47 | $this->assertContains("firstName", $fieldsName); |
|
| 48 | $this->assertContains("lastName", $fieldsName); |
|
| 49 | $this->assertNotContains("dob", $fieldsName); |
|
| 50 | } |
|
| 51 | ||
| 52 | public function testEntityPropertyType() { |
|
| 53 | $this->service->generateMarkupForEntity('Test\TestBundle\Model\Person'); |
|
| @@ 24-34 (lines=11) @@ | ||
| 21 | $this->service->setTwigEngine($this->twigEngine); |
|
| 22 | } |
|
| 23 | ||
| 24 | public function testDocumentProperty() { |
|
| 25 | $this->service->generateMarkupForEntity('Test\TestBundle\Document\Order'); |
|
| 26 | $this->assertContains("Test.document.Order", $this->twigEngine->renderParameters['name']); |
|
| 27 | $fieldsName = array(); |
|
| 28 | foreach ($this->twigEngine->renderParameters['fields'] as $field) { |
|
| 29 | $fieldsName[] = $field['name']; |
|
| 30 | } |
|
| 31 | $this->assertContains("id", $fieldsName); |
|
| 32 | $this->assertContains("name", $fieldsName); |
|
| 33 | $this->assertContains("totalPrice", $fieldsName); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testDocumentPropertyType() { |
|
| 37 | $this->service->generateMarkupForEntity('Test\TestBundle\Document\Order'); |
|