99use Ibexa \Contracts \Core \Event \ResolveUrlAliasSchemaEvent ;
1010use Ibexa \Contracts \Core \Repository \Values \Content \Field ;
1111use Ibexa \Core \FieldType \TextLine \Value as TextLineValue ;
12- use Ibexa \Core \Repository \Helper \NameSchemaService ;
12+ use Ibexa \Core \Repository \NameSchema \NameSchemaService ;
1313use Ibexa \Core \Repository \Values \Content \Content ;
1414use Ibexa \Core \Repository \Values \Content \VersionInfo ;
1515use Ibexa \Core \Repository \Values \ContentType \ContentType ;
@@ -27,13 +27,14 @@ public function testResolveUrlAliasSchema()
2727 $ contentType = $ this ->buildTestContentType ();
2828
2929 $ serviceMock = $ this ->getMockBuilder (NameSchemaService::class)
30+ ->setMethods (['resolve ' ])
3031 ->setConstructorArgs (
3132 [
3233 $ this ->getPersistenceMock ()->contentTypeHandler (),
3334 $ this ->getContentTypeDomainMapperMock (),
3435 $ this ->getFieldTypeRegistryMock (),
3536 $ this ->getSchemaIdentifierExtractorMock (),
36- $ this ->getEventDispatcherMock (['field ' => '<urlalias_schema> ' ], $ content , [' <urlalias_schema> ' => 42 ]),
37+ $ this ->getEventDispatcherMock (['field ' => '<urlalias_schema> ' ], $ content , []),
3738 ]
3839 )
3940 ->getMock ();
@@ -49,13 +50,14 @@ public function testResolveUrlAliasSchemaFallbackToNameSchema()
4950 $ contentType = $ this ->buildTestContentType ('<name_schema> ' , '' );
5051
5152 $ serviceMock = $ this ->getMockBuilder (NameSchemaService::class)
53+ ->setMethods (['resolve ' ])
5254 ->setConstructorArgs (
5355 [
5456 $ this ->getPersistenceMock ()->contentTypeHandler (),
5557 $ this ->getContentTypeDomainMapperMock (),
5658 $ this ->getFieldTypeRegistryMock (),
5759 $ this ->getSchemaIdentifierExtractorMock (),
58- $ this ->getEventDispatcherMock (['field ' => '<name_schema> ' ], $ content , [' <name_schema> ' => null ]),
60+ $ this ->getEventDispatcherMock (['field ' => '<name_schema> ' ], $ content , []),
5961 ]
6062 )
6163 ->getMock ();
@@ -82,12 +84,12 @@ public function testResolveNameSchema()
8284 $ this ->equalTo ($ content ->fields ),
8385 $ this ->equalTo ($ content ->versionInfo ->languageCodes )
8486 )->will (
85- $ this ->returnValue (42 )
87+ $ this ->returnValue ([ 42 ] )
8688 );
8789
8890 $ result = $ serviceMock ->resolveNameSchema ($ content , [], [], $ contentType );
8991
90- self ::assertEquals (42 , $ result );
92+ self ::assertEquals ([ 42 ] , $ result );
9193 }
9294
9395 public function testResolveNameSchemaWithFields ()
@@ -120,12 +122,12 @@ public function testResolveNameSchemaWithFields()
120122 $ this ->equalTo ($ mergedFields ),
121123 $ this ->equalTo ($ languages )
122124 )->will (
123- $ this ->returnValue (42 )
125+ $ this ->returnValue ([ 42 ] )
124126 );
125127
126128 $ result = $ serviceMock ->resolveNameSchema ($ content , $ fields , $ languages , $ contentType );
127129
128- self ::assertEquals (42 , $ result );
130+ self ::assertEquals ([ 42 ] , $ result );
129131 }
130132
131133 /**
@@ -171,9 +173,9 @@ public function testResolve(
171173 }
172174
173175 /**
174- * Data provider for the @return array .
176+ * Data provider for the @see testResolve method .
175177 *
176- * @see testResolve method.
178+ * @return array
177179 */
178180 public function resolveDataProvider ()
179181 {
0 commit comments