Skip to content

Commit

Permalink
doctrine#1277 DDC-3346 DDC-3531 - refactoring test assets for readabi…
Browse files Browse the repository at this point in the history
…lity
  • Loading branch information
Ocramius committed Jan 24, 2015
1 parent 36bc448 commit 04a271a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions tests/Doctrine/Tests/Models/DDC3346/DDC3346Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@
*/
class DDC3346Article
{
const CLASSNAME = 'Doctrine\Tests\Models\DDC3346\DDC3346Article';
const CLASSNAME = __CLASS__;

/**
* @Id
* @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
public $id;

/**
* @var DDC3346Author
*
* @ManyToOne(targetEntity="DDC3346Author", inversedBy="articles")
* @JoinColumn(name="user_id", referencedColumnName="id")
*/
public $user;

public function setAuthor(DDC3346Author $author)
{
$this->user = $author;
}
}
7 changes: 5 additions & 2 deletions tests/Doctrine/Tests/Models/DDC3346/DDC3346Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
*/
class DDC3346Author
{
const CLASSNAME = 'Doctrine\Tests\Models\DDC3346\DDC3346Author';
const CLASSNAME = __CLASS__;

/**
* @Id @Column(type="integer")
* @GeneratedValue
*/
public $id;

/**
* @Column(type="string", length=255, unique=true)
*/
public $username;

/**
* @OneToMany(targetEntity="DDC3346Article", mappedBy="user", fetch="EAGER", cascade={"detach"})
*/
public $articles;
public $articles = array();
}

0 comments on commit 04a271a

Please sign in to comment.