Skip to content

Commit 48716da

Browse files
committed
Update mapping tests for misc. extensions
1 parent 01365af commit 48716da

34 files changed

+908
-843
lines changed

phpstan-baseline.neon

Lines changed: 48 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,54 @@ parameters:
10621062
count: 1
10631063
path: tests/Gedmo/Mapping/Fixture/Category.php
10641064

1065+
-
1066+
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\.$#'
1067+
identifier: property.unusedType
1068+
count: 1
1069+
path: tests/Gedmo/Mapping/Fixture/Referenced.php
1070+
1071+
-
1072+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Referencer\:\:\$id \(string\|null\) is never assigned string so it can be removed from the property type\.$#'
1073+
identifier: property.unusedType
1074+
count: 1
1075+
path: tests/Gedmo/Mapping/Fixture/Referencer.php
1076+
1077+
-
1078+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Referencing\:\:\$id \(string\|null\) is never assigned string so it can be removed from the property type\.$#'
1079+
identifier: property.unusedType
1080+
count: 1
1081+
path: tests/Gedmo/Mapping/Fixture/Referencing.php
1082+
1083+
-
1084+
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\.$#'
1085+
identifier: property.unusedType
1086+
count: 1
1087+
path: tests/Gedmo/Mapping/Fixture/Referencing.php
1088+
1089+
-
1090+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\Category\:\:\$changed \(DateTime\|null\) is never assigned DateTime so it can be removed from the property type\.$#'
1091+
identifier: property.unusedType
1092+
count: 1
1093+
path: tests/Gedmo/Mapping/Fixture/Xml/Category.php
1094+
1095+
-
1096+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\Category\:\:\$id \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
1097+
identifier: property.unusedType
1098+
count: 1
1099+
path: tests/Gedmo/Mapping/Fixture/Xml/Category.php
1100+
1101+
-
1102+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\ClosureCategory\:\:\$id \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
1103+
identifier: property.unusedType
1104+
count: 1
1105+
path: tests/Gedmo/Mapping/Fixture/Xml/ClosureCategory.php
1106+
1107+
-
1108+
message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Xml\\MaterializedPathCategory\:\:\$id \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
1109+
identifier: property.unusedType
1110+
count: 1
1111+
path: tests/Gedmo/Mapping/Fixture/Xml/MaterializedPathCategory.php
1112+
10651113
-
10661114
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
10671115
identifier: class.notFound
@@ -1152,66 +1200,12 @@ parameters:
11521200
count: 1
11531201
path: tests/Gedmo/Mapping/ORMMappingTestCase.php
11541202

1155-
-
1156-
message: '#^Property Gedmo\\Tests\\Mapping\\ReferenceIntegrityMappingTest\:\:\$dm is never written, only read\.$#'
1157-
identifier: property.onlyRead
1158-
count: 1
1159-
path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php
1160-
1161-
-
1162-
message: '#^Property Gedmo\\Tests\\Mapping\\ReferenceIntegrityMappingTest\:\:\$referenceIntegrity is never written, only read\.$#'
1163-
identifier: property.onlyRead
1164-
count: 1
1165-
path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php
1166-
1167-
-
1168-
message: '#^Unreachable statement \- code above always terminates\.$#'
1169-
identifier: deadCode.unreachable
1170-
count: 1
1171-
path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php
1172-
11731203
-
11741204
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
11751205
identifier: class.notFound
11761206
count: 1
11771207
path: tests/Gedmo/Mapping/TreeMappingTest.php
11781208

1179-
-
1180-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\YamlDriver not found\.$#'
1181-
identifier: class.notFound
1182-
count: 1
1183-
path: tests/Gedmo/Mapping/TreeMappingTest.php
1184-
1185-
-
1186-
message: '#^Parameter \#1 \$nestedDriver of method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriverChain\:\:addDriver\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\YamlDriver given\.$#'
1187-
identifier: argument.type
1188-
count: 1
1189-
path: tests/Gedmo/Mapping/TreeMappingTest.php
1190-
1191-
-
1192-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1193-
identifier: class.notFound
1194-
count: 1
1195-
path: tests/Gedmo/Mapping/Xml/ClosureTreeMappingTest.php
1196-
1197-
-
1198-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1199-
identifier: class.notFound
1200-
count: 1
1201-
path: tests/Gedmo/Mapping/Xml/MaterializedPathTreeMappingTest.php
1202-
1203-
-
1204-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1205-
identifier: class.notFound
1206-
count: 1
1207-
path: tests/Gedmo/Mapping/Xml/ReferencesMappingTest.php
1208-
1209-
-
1210-
message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#'
1211-
identifier: class.notFound
1212-
count: 1
1213-
path: tests/Gedmo/Mapping/Xml/TranslatableMappingTest.php
1214-
12151209
-
12161210
message: '#^Method Gedmo\\Tests\\Sluggable\\Fixture\\Doctrine\\FakeFilter\:\:addFilterConstraint\(\) has parameter \$targetTableAlias with no type specified\.$#'
12171211
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.

tests/Gedmo/Mapping/Driver/Xml/Gedmo.Tests.Mapping.Fixture.Xml.MaterializedPathTree.dcm.xml renamed to tests/Gedmo/Mapping/Driver/Xml/Gedmo.Tests.Mapping.Fixture.Xml.MaterializedPathCategory.dcm.xml

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)