Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c877884

Browse files
committed
Added unit-tests
1 parent dabfa8a commit c877884

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function testGetProperties()
7171
'indexedByDt',
7272
'indexedByCustomType',
7373
'indexedBuz',
74+
'dummyGeneratedValueList',
7475
]);
7576

7677
$this->assertEquals(
@@ -198,6 +199,14 @@ public function typesProvider()
198199
new Type(Type::BUILTIN_TYPE_STRING),
199200
new Type(Type::BUILTIN_TYPE_OBJECT, false, DoctrineRelation::class)
200201
)]],
202+
['dummyGeneratedValueList', [new Type(
203+
Type::BUILTIN_TYPE_OBJECT,
204+
false,
205+
'Doctrine\Common\Collections\Collection',
206+
true,
207+
new Type(Type::BUILTIN_TYPE_INT),
208+
new Type(Type::BUILTIN_TYPE_OBJECT, false, DoctrineRelation::class)
209+
)]],
201210
['json', null],
202211
];
203212

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ class DoctrineDummy
138138
*/
139139
protected $indexedBuz;
140140

141+
/**
142+
* @OneToMany(targetEntity="DoctrineRelation", mappedBy="dummyRelation", indexBy="gen_value_col_id", orphanRemoval=true)
143+
*/
144+
protected $dummyGeneratedValueList;
145+
141146
/**
142147
* @Column(type="json", nullable=true)
143148
*/

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineGeneratedValue.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Doctrine\ORM\Mapping\Entity;
1616
use Doctrine\ORM\Mapping\GeneratedValue;
1717
use Doctrine\ORM\Mapping\Id;
18+
use Doctrine\ORM\Mapping\OneToMany;
1819

1920
/**
2021
* @author Kévin Dunglas <[email protected]>
@@ -34,4 +35,15 @@ class DoctrineGeneratedValue
3435
* @Column
3536
*/
3637
public $foo;
38+
39+
/**
40+
* @var int
41+
* @Column(type="integer", name="gen_value_col_id")
42+
*/
43+
public $valueId;
44+
45+
/**
46+
* @OneToMany(targetEntity="DoctrineRelation", mappedBy="generatedValueRelation", indexBy="rguid_column", orphanRemoval=true)
47+
*/
48+
protected $relationList;
3749
}

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineRelation.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Doctrine\ORM\Mapping\Entity;
1616
use Doctrine\ORM\Mapping\Id;
1717
use Doctrine\ORM\Mapping\ManyToOne;
18+
use Doctrine\ORM\Mapping\JoinColumn;
1819

1920
/**
2021
* @Entity
@@ -60,4 +61,15 @@ class DoctrineRelation
6061
* @ManyToOne(targetEntity="DoctrineDummy", inversedBy="indexedBuz")
6162
*/
6263
protected $buzField;
64+
65+
/**
66+
* @ManyToOne(targetEntity="DoctrineDummy", inversedBy="dummyGeneratedValueList")
67+
*/
68+
private $dummyRelation;
69+
70+
/**
71+
* @ManyToOne(targetEntity="DoctrineGeneratedValue", inversedBy="relationList")
72+
* @JoinColumn(name="gen_value_col_id", referencedColumnName="gen_value_col_id")
73+
*/
74+
private $generatedValueRelation;
6375
}

0 commit comments

Comments
 (0)