1616use Ibexa \AdminUi \Behat \Page \ContentTypeUpdatePage ;
1717use PHPUnit \Framework \Assert ;
1818
19- class ContentTypeContext implements Context
19+ final readonly class ContentTypeContext implements Context
2020{
21- private ContentTypePage $ contentTypePage ;
22-
23- private ContentTypeUpdatePage $ contentTypeUpdatePage ;
24-
25- private ContentTypeGroupPage $ contentTypeGroupPage ;
26-
27- private ContentTypeGroupsPage $ contentTypeGroupsPage ;
28-
2921 public function __construct (
30- ContentTypePage $ contentTypePage ,
31- ContentTypeUpdatePage $ contentTypeUpdatePage ,
32- ContentTypeGroupPage $ contentTypeGroupPage ,
33- ContentTypeGroupsPage $ contentTypeGroupsPage
22+ private ContentTypePage $ contentTypePage ,
23+ private ContentTypeUpdatePage $ contentTypeUpdatePage ,
24+ private ContentTypeGroupPage $ contentTypeGroupPage ,
25+ private ContentTypeGroupsPage $ contentTypeGroupsPage
3426 ) {
35- $ this ->contentTypePage = $ contentTypePage ;
36- $ this ->contentTypeUpdatePage = $ contentTypeUpdatePage ;
37- $ this ->contentTypeGroupPage = $ contentTypeGroupPage ;
38- $ this ->contentTypeGroupsPage = $ contentTypeGroupsPage ;
3927 }
4028
4129 /**
@@ -79,7 +67,7 @@ public function contentTypeHasProperFields(TableNode $table): void
7967 /**
8068 * @Given there's no :contentTypeName on content types list
8169 */
82- public function thereSNoOnContentTypesList ($ contentTypeName ): void
70+ public function thereSNoOnContentTypesList (string $ contentTypeName ): void
8371 {
8472 Assert::assertFalse ($ this ->contentTypeGroupPage ->isContentTypeOnTheList ($ contentTypeName ));
8573 }
@@ -103,7 +91,7 @@ public function thereSAOnContentTypesGroupList(string $contentTypeGroupName): vo
10391 /**
10492 * @Given there's a :contentTypeName on content types list
10593 */
106- public function thereAContentTypeOnContentTypesList ($ contentTypeName ): void
94+ public function thereAContentTypeOnContentTypesList (string $ contentTypeName ): void
10795 {
10896 Assert::assertTrue ($ this ->contentTypeGroupPage ->isContentTypeOnTheList ($ contentTypeName ));
10997 }
@@ -129,9 +117,9 @@ public function iAddField(string $fieldName): void
129117 /**
130118 * @When I set :field to :value for :fieldName field
131119 */
132- public function iSetFieldDefinitionData (string $ label , string $ value, string $ fieldName ): void
120+ public function iSetFieldDefinitionData (string $ label , string $ value ): void
133121 {
134- $ this ->contentTypeUpdatePage ->fillFieldDefinitionFieldWithValue ($ fieldName , $ label , $ value );
122+ $ this ->contentTypeUpdatePage ->fillFieldDefinitionFieldWithValue ($ label , $ value );
135123 }
136124
137125 /**
@@ -232,7 +220,7 @@ public function contentTypeGroupCannotBeSelected(string $contentTypeGroupName):
232220 public function iCheckBlockInField (string $ blockName ): void
233221 {
234222 $ this ->contentTypeUpdatePage ->verifyIsLoaded ();
235- $ this ->contentTypeUpdatePage ->expandLastFieldDefinition (' fieldDefinitionOpenContainerEdit ' );
223+ $ this ->contentTypeUpdatePage ->expandLastFieldDefinition ();
236224 $ this ->contentTypeUpdatePage ->expandDefaultBlocksOption ();
237225 $ this ->contentTypeUpdatePage ->selectBlock ($ blockName );
238226 }
0 commit comments