From 04a271a04ea53650d8cf8a6f54f91e1d966af6b7 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 23 Jan 2015 16:22:17 +0100 Subject: [PATCH] #1277 DDC-3346 DDC-3531 - refactoring test assets for readability --- .../Doctrine/Tests/Models/DDC3346/DDC3346Article.php | 11 +++++------ tests/Doctrine/Tests/Models/DDC3346/DDC3346Author.php | 7 +++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/Doctrine/Tests/Models/DDC3346/DDC3346Article.php b/tests/Doctrine/Tests/Models/DDC3346/DDC3346Article.php index 127209dcb..dc8a876c5 100644 --- a/tests/Doctrine/Tests/Models/DDC3346/DDC3346Article.php +++ b/tests/Doctrine/Tests/Models/DDC3346/DDC3346Article.php @@ -8,21 +8,20 @@ namespace Doctrine\Tests\Models\DDC3346; */ 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; - } } diff --git a/tests/Doctrine/Tests/Models/DDC3346/DDC3346Author.php b/tests/Doctrine/Tests/Models/DDC3346/DDC3346Author.php index a24d9a601..5229ee280 100644 --- a/tests/Doctrine/Tests/Models/DDC3346/DDC3346Author.php +++ b/tests/Doctrine/Tests/Models/DDC3346/DDC3346Author.php @@ -8,18 +8,21 @@ namespace Doctrine\Tests\Models\DDC3346; */ 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(); }