Skip to content

Commit

Permalink
Fix tests written by @rvanlaak
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Feb 27, 2023
1 parent 1de78f7 commit 1a64152
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php

declare(strict_types=1);

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Tests\OrmFunctionalTestCase;

/**
Expand Down Expand Up @@ -70,22 +73,24 @@ public function testIssue(): void
}

/**
* @Entity()
* @Table("ddc6499_application")
* @ORM\Entity
* @ORM\Table("ddc6499_application")
*/
class Application
{
/**
* @Id
* @GeneratedValue
* @Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @var int
*/
public $id;

/**
* @OneToMany(targetEntity=ApplicationPerson::class, mappedBy="application", orphanRemoval=true, cascade={"persist"})
* @JoinColumn(nullable=false)
* @ORM\OneToMany(targetEntity=ApplicationPerson::class, mappedBy="application", orphanRemoval=true, cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*
* @var Collection
*/
private $applicationPeople;
Expand All @@ -101,22 +106,24 @@ public function getApplicationPeople(): Collection
}
}
/**
* @Entity()
* @Table("ddc6499_person")
* @ORM\Entity()
* @ORM\Table("ddc6499_person")
*/
class Person
{
/**
* @Id
* @GeneratedValue
* @Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @var int
*/
public $id;

/**
* @OneToMany(targetEntity=ApplicationPerson::class, mappedBy="person", orphanRemoval=true, cascade={"persist"})
* @JoinColumn(nullable=false)
* @ORM\OneToMany(targetEntity=ApplicationPerson::class, mappedBy="person", orphanRemoval=true, cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*
* @var Collection
*/
private $applicationPeople;
Expand All @@ -133,29 +140,32 @@ public function getApplicationPeople(): Collection
}

/**
* @Entity()
* @Table("ddc6499_application_person")
* @ORM\Entity()
* @ORM\Table("ddc6499_application_person")
*/
class ApplicationPerson
{
/**
* @Id
* @GeneratedValue
* @Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @var int
*/
public $id;

/**
* @ManyToOne(targetEntity=Application::class, inversedBy="applicationPeople", cascade={"persist"})
* @JoinColumn(nullable=false)
* @ORM\ManyToOne(targetEntity=Application::class, inversedBy="applicationPeople", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*
* @var Application
*/
public $application;

/**
* @ManyToOne(targetEntity=Person::class, inversedBy="applicationPeople", cascade={"persist"})
* @JoinColumn(nullable=false)
* @ORM\ManyToOne(targetEntity=Person::class, inversedBy="applicationPeople", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*
* @var Person
*/
public $person;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

declare(strict_types=1);

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Tests\OrmFunctionalTestCase;

/**
Expand Down Expand Up @@ -52,20 +55,22 @@ public function testIssue(): void
}
}

/** @Entity */
/** @ORM\Entity */
class DDC6499A
{
/**
* @Id
* @Column(type="integer")
* @GeneratedValue
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*
* @var int
*/
public $id;

/**
* @OneToOne(targetEntity="DDC6499B", cascade={"persist"})
* @JoinColumn(nullable=false)
* @ORM\OneToOne(targetEntity="DDC6499B", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*
* @var DDC6499B
*/
public $b;
Expand All @@ -76,13 +81,14 @@ public function __construct()
}
}

/** @Entity */
/** @ORM\Entity */
class DDC6499B
{
/**
* @Id
* @Column(type="integer")
* @GeneratedValue
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*
* @var int
*/
public $id;
Expand Down

0 comments on commit 1a64152

Please sign in to comment.