Skip to content

Commit

Permalink
minor #159 Improve form tests to cover one-to-many association (sadik…
Browse files Browse the repository at this point in the history
…off)

This PR was merged into the 1.0-dev branch.

Discussion
----------

Improve form tests to cover one-to-many association

Commits
-------

c7c8f72 improve form tests to cover one-to-many association
  • Loading branch information
weaverryan committed Apr 22, 2018
2 parents cd86cd2 + c7c8f72 commit 45fe88c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/fixtures/MakeFormForEntity/src/Entity/Property.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
class Property
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;

/**
* Many Features have One Product.
* @ORM\ManyToOne(targetEntity="App\Entity\SourFood", inversedBy="properties")
* @ORM\JoinColumn(name="sour_food_id", referencedColumnName="id")
*/
private $sourFood;
}
11 changes: 11 additions & 0 deletions tests/fixtures/MakeFormForEntity/src/Entity/SourFood.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
Expand All @@ -21,6 +22,16 @@ class SourFood
*/
private $title;

/**
* @ORM\OneToMany(targetEntity="App\Entity\Property", mappedBy="sourFood")
*/
private $properties;

public function __construct()
{
$this->properties = new ArrayCollection();
}

/**
* @return mixed
*/
Expand Down

0 comments on commit 45fe88c

Please sign in to comment.