Skip to content

Commit a95cccf

Browse files
committed
Update mapping tests for misc. extensions
1 parent 3ca38e8 commit a95cccf

34 files changed

+908
-843
lines changed

phpstan-baseline.neon

Lines changed: 48 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,54 @@ parameters:
10201020
count: 1
10211021
path: tests/Gedmo/Mapping/Fixture/Category.php
10221022

1023+
-
1024+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Referenced\:\:\$referencer \(Gedmo\\Tests\\Mapping\\Fixture\\Referencer\|null\) is never assigned Gedmo\\Tests\\Mapping\\Fixture\\Referencer so it can be removed from the property type\.$#'
1025+
identifier: property.unusedType
1026+
count: 1
1027+
path: tests/Gedmo/Mapping/Fixture/Referenced.php
1028+
1029+
-
1030+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Referencer\:\:\$id \(string\|null\) is never assigned string so it can be removed from the property type\.$#'
1031+
identifier: property.unusedType
1032+
count: 1
1033+
path: tests/Gedmo/Mapping/Fixture/Referencer.php
1034+
1035+
-
1036+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Referencing\:\:\$id \(string\|null\) is never assigned string so it can be removed from the property type\.$#'
1037+
identifier: property.unusedType
1038+
count: 1
1039+
path: tests/Gedmo/Mapping/Fixture/Referencing.php
1040+
1041+
-
1042+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Referencing\:\:\$referencer \(Gedmo\\Tests\\Mapping\\Fixture\\Referencer\|null\) is never assigned Gedmo\\Tests\\Mapping\\Fixture\\Referencer so it can be removed from the property type\.$#'
1043+
identifier: property.unusedType
1044+
count: 1
1045+
path: tests/Gedmo/Mapping/Fixture/Referencing.php
1046+
1047+
-
1048+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\Category\:\:\$changed \(DateTime\|null\) is never assigned DateTime so it can be removed from the property type\.$#'
1049+
identifier: property.unusedType
1050+
count: 1
1051+
path: tests/Gedmo/Mapping/Fixture/Xml/Category.php
1052+
1053+
-
1054+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\Category\:\:\$id \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
1055+
identifier: property.unusedType
1056+
count: 1
1057+
path: tests/Gedmo/Mapping/Fixture/Xml/Category.php
1058+
1059+
-
1060+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\ClosureCategory\:\:\$id \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
1061+
identifier: property.unusedType
1062+
count: 1
1063+
path: tests/Gedmo/Mapping/Fixture/Xml/ClosureCategory.php
1064+
1065+
-
1066+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\MaterializedPathCategory\:\:\$id \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
1067+
identifier: property.unusedType
1068+
count: 1
1069+
path: tests/Gedmo/Mapping/Fixture/Xml/MaterializedPathCategory.php
1070+
10231071
-
10241072
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
10251073
identifier: class.notFound
@@ -1110,66 +1158,12 @@ parameters:
11101158
count: 1
11111159
path: tests/Gedmo/Mapping/ORMMappingTestCase.php
11121160

1113-
-
1114-
message: '#^Property Gedmo\\Tests\\Mapping\\ReferenceIntegrityMappingTest\:\:\$dm is never written, only read\.$#'
1115-
identifier: property.onlyRead
1116-
count: 1
1117-
path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php
1118-
1119-
-
1120-
message: '#^Property Gedmo\\Tests\\Mapping\\ReferenceIntegrityMappingTest\:\:\$referenceIntegrity is never written, only read\.$#'
1121-
identifier: property.onlyRead
1122-
count: 1
1123-
path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php
1124-
1125-
-
1126-
message: '#^Unreachable statement \- code above always terminates\.$#'
1127-
identifier: deadCode.unreachable
1128-
count: 1
1129-
path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php
1130-
11311161
-
11321162
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
11331163
identifier: class.notFound
11341164
count: 1
11351165
path: tests/Gedmo/Mapping/TreeMappingTest.php
11361166

1137-
-
1138-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\YamlDriver not found\.$#'
1139-
identifier: class.notFound
1140-
count: 1
1141-
path: tests/Gedmo/Mapping/TreeMappingTest.php
1142-
1143-
-
1144-
message: '#^Parameter \#1 \$nestedDriver of method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriverChain\:\:addDriver\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\YamlDriver given\.$#'
1145-
identifier: argument.type
1146-
count: 1
1147-
path: tests/Gedmo/Mapping/TreeMappingTest.php
1148-
1149-
-
1150-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1151-
identifier: class.notFound
1152-
count: 1
1153-
path: tests/Gedmo/Mapping/Xml/ClosureTreeMappingTest.php
1154-
1155-
-
1156-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1157-
identifier: class.notFound
1158-
count: 1
1159-
path: tests/Gedmo/Mapping/Xml/MaterializedPathTreeMappingTest.php
1160-
1161-
-
1162-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1163-
identifier: class.notFound
1164-
count: 1
1165-
path: tests/Gedmo/Mapping/Xml/ReferencesMappingTest.php
1166-
1167-
-
1168-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1169-
identifier: class.notFound
1170-
count: 1
1171-
path: tests/Gedmo/Mapping/Xml/TranslatableMappingTest.php
1172-
11731167
-
11741168
message: '#^Method Gedmo\\Tests\\Sluggable\\Fixture\\Doctrine\\FakeFilter\:\:addFilterConstraint\(\) has parameter \$targetTableAlias with no type specified\.$#'
11751169
identifier: missingType.parameter
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
3+
<mapped-superclass name="Gedmo\Tests\Mapping\Fixture\Xml\BaseCategory">
4+
<field name="left" type="integer">
5+
<gedmo:tree-left/>
6+
</field>
7+
<field name="right" type="integer">
8+
<gedmo:tree-right/>
9+
</field>
10+
<field name="rooted" type="integer">
11+
<gedmo:tree-root/>
12+
</field>
13+
<field name="level" type="integer">
14+
<gedmo:tree-level/>
15+
</field>
16+
<field name="created" type="datetime">
17+
<gedmo:timestampable on="create"/>
18+
</field>
19+
<field name="updated" type="datetime">
20+
<gedmo:timestampable on="update"/>
21+
</field>
22+
</mapped-superclass>
23+
</doctrine-mapping>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
3+
<entity name="Gedmo\Tests\Mapping\Fixture\Xml\Category" table="categories">
4+
<indexes>
5+
<index name="search_idx" columns="title"/>
6+
</indexes>
7+
<id name="id" type="integer">
8+
<generator/>
9+
</id>
10+
<field name="title" length="64">
11+
<gedmo:translatable/>
12+
</field>
13+
<field name="slug" length="64">
14+
<gedmo:slug separator="_" style="camel" fields="title">
15+
<gedmo:handler class="Gedmo\Sluggable\Handler\RelativeSlugHandler">
16+
<gedmo:handler-option name="relationField" value="parent"/>
17+
<gedmo:handler-option name="relationSlugField" value="slug"/>
18+
<gedmo:handler-option name="separator" value="/"/>
19+
</gedmo:handler>
20+
<gedmo:handler class="Gedmo\Sluggable\Handler\TreeSlugHandler">
21+
<gedmo:handler-option name="parentRelationField" value="parent"/>
22+
<gedmo:handler-option name="separator" value="/"/>
23+
</gedmo:handler>
24+
</gedmo:slug>
25+
</field>
26+
<field name="changed" type="date">
27+
<gedmo:timestampable on="change" field="title" value="Test"/>
28+
</field>
29+
<many-to-one field="parent" target-entity="Gedmo\Tests\Mapping\Fixture\Xml\Category" inversed-by="children">
30+
<join-column name="parent_id"/>
31+
<gedmo:tree-parent/>
32+
</many-to-one>
33+
<one-to-many field="children" target-entity="Gedmo\Tests\Mapping\Fixture\Xml\Category" mapped-by="parent"/>
34+
<gedmo:translation entity="Gedmo\Tests\Translatable\Fixture\CategoryTranslation" locale="localeField"/>
35+
<gedmo:tree type="nested"/>
36+
<gedmo:loggable/>
37+
</entity>
38+
</doctrine-mapping>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
3+
<entity name="Gedmo\Tests\Mapping\Fixture\Xml\ClosureCategory" table="closure_categories">
4+
<indexes>
5+
<index name="search_idx" columns="title"/>
6+
</indexes>
7+
<id name="id" type="integer">
8+
<generator/>
9+
</id>
10+
<field name="title" length="64"/>
11+
<field name="level" type="integer">
12+
<gedmo:tree-level/>
13+
</field>
14+
<many-to-one field="parent" target-entity="Gedmo\Tests\Mapping\Fixture\Xml\ClosureCategory" inversed-by="children">
15+
<join-column name="parent_id"/>
16+
<gedmo:tree-parent/>
17+
</many-to-one>
18+
<one-to-many field="children" target-entity="Gedmo\Tests\Mapping\Fixture\Xml\ClosureCategory" mapped-by="parent"/>
19+
<gedmo:tree type="closure"/>
20+
<gedmo:tree-closure class="Gedmo\Tests\Tree\Fixture\Closure\CategoryClosureWithoutMapping"/>
21+
</entity>
22+
</doctrine-mapping>

tests/Gedmo/Mapping/Driver/Xml/Gedmo.Tests.Mapping.Fixture.Xml.ClosureTree.dcm.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
3-
<entity name="Gedmo\Tests\Mapping\Fixture\Xml\MaterializedPathTree" table="materialized_path_trees">
3+
<entity name="Gedmo\Tests\Mapping\Fixture\Xml\MaterializedPathCategory" table="materialized_path_categories">
44
<indexes>
5-
<index name="title_idx" columns="title"/>
5+
<index name="search_idx" columns="title"/>
66
</indexes>
7-
<id name="id" type="integer" column="id">
8-
<generator strategy="AUTO"/>
7+
<id name="id" type="integer">
8+
<generator/>
99
</id>
10-
<field name="level" column="lvl" type="integer">
11-
<gedmo:tree-level/>
12-
</field>
13-
<field name="title" type="string" length="64">
10+
<field name="title" length="64">
1411
<gedmo:tree-path-source/>
1512
</field>
16-
<field name="path" type="string" length="3000">
13+
<field name="path" length="3000">
1714
<gedmo:tree-path separator=","/>
1815
</field>
16+
<field name="level" type="integer">
17+
<gedmo:tree-level/>
18+
</field>
1919
<field name="lockTime" type="datetime">
2020
<gedmo:tree-lock-time/>
2121
</field>
22-
<field name="pathHash" type="string" nullable="true">
23-
<gedmo:tree-path-hash/>
24-
</field>
25-
<many-to-one field="parent" target-entity="MaterializedPathTree">
26-
<join-column name="parent_id" referenced-column-name="id" on-delete="CASCADE"/>
22+
<many-to-one field="parent" target-entity="Gedmo\Tests\Mapping\Fixture\Xml\MaterializedPathCategory" inversed-by="children">
23+
<join-column name="parent_id"/>
2724
<gedmo:tree-parent/>
2825
</many-to-one>
29-
<gedmo:tree type="materializedPath" activate-locking="true" locking-timeout="10"/>
26+
<gedmo:tree type="materializedPath" activate-locking="true"/>
3027
</entity>
3128
</doctrine-mapping>

tests/Gedmo/Mapping/Driver/Xml/Gedmo.Tests.Mapping.Fixture.Xml.NestedTree.dcm.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/Gedmo/Mapping/Driver/Xml/Gedmo.Tests.Mapping.Fixture.Xml.References.dcm.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/Gedmo/Mapping/Driver/Xml/Gedmo.Tests.Mapping.Fixture.Xml.Translatable.dcm.xml

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/Gedmo/Mapping/Fixture/ClosureTreeClosure.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)