Skip to content

Commit

Permalink
Update test according to @Ocramius notes
Browse files Browse the repository at this point in the history
  • Loading branch information
scaytrase committed Jan 22, 2015
1 parent 41a6f54 commit c233d5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
5 changes: 1 addition & 4 deletions tests/Doctrine/Tests/Models/DDC3346/DDC3346Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
class DDC3346Article
{
const CLASSNAME = 'Doctrine\Tests\Models\DDC3346\DDC3346Article';
/**
* @Id
* @Column(type="integer")
Expand All @@ -19,10 +20,6 @@ class DDC3346Article
* @JoinColumn(name="user_id", referencedColumnName="id")
*/
public $user;
/**
* @Column(type="text")
*/
public $text;

public function setAuthor(DDC3346Author $author)
{
Expand Down
9 changes: 1 addition & 8 deletions tests/Doctrine/Tests/Models/DDC3346/DDC3346Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,16 @@
*/
class DDC3346Author
{
const CLASSNAME = 'Doctrine\Tests\Models\DDC3346\DDC3346Author';
/**
* @Id @Column(type="integer")
* @GeneratedValue
*/
public $id;
/**
* @Column(type="string", length=50, nullable=true)
*/
public $status;
/**
* @Column(type="string", length=255, unique=true)
*/
public $username;
/**
* @Column(type="string", length=255)
*/
public $name;
/**
* @OneToMany(targetEntity="DDC3346Article", mappedBy="user", fetch="EAGER", cascade={"detach"})
*/
Expand Down
8 changes: 2 additions & 6 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3346Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,21 @@ public function setUp()

$this->setUpEntitySchema(
array(
'Doctrine\Tests\Models\DDC3346\DDC3346Article',
'Doctrine\Tests\Models\DDC3346\DDC3346Author',
DDC3346Author::CLASSNAME,
DDC3346Article::CLASSNAME,
)
);
}

public function testFindOneByWithEagerFetch()
{
$user = new DDC3346Author();
$user->name = "Buggy Woogy";
$user->username = "bwoogy";
$user->status = "active";

$article1 = new DDC3346Article();
$article1->text = "First content";
$article1->setAuthor($user);

$article2 = new DDC3346Article();
$article2->text = "Second content";
$article2->setAuthor($user);

$this->_em->persist($user);
Expand Down

0 comments on commit c233d5c

Please sign in to comment.