Skip to content

Commit 88c7acd

Browse files
committed
- chore!: change FieldWithPhoneFormat.phoneFormat from PhoneFieldFormatEnum to GfPhoneFormat.
1 parent 9cb3da9 commit 88c7acd

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- chore!: Bump minimum required Gravity Forms version to 2.9.0
88
- chore!: Bump minimum required WPGraphQL version to 2.5.0
99
- chore!: Remove the following deprecated fields: `FieldWithPhoneFormat._phoneFormatExperimental` field. `FieldWithProductField.productField` field.
10-
- chore!: Change the following field types: `FieldWithPhoneFormat.phoneFormat` from `PhoneFieldFormatEnum` to `GfPhoneFormat`.
10+
- chore!: change `FieldWithPhoneFormat.phoneFormat` from `PhoneFieldFormatEnum` to `GfPhoneFormat`.
1111
- chore!: Remove the following unused methods: `Utils::to_snake_case()`, `Utils::deprecate_property()`.
1212
- chore: Test compatibility against PHP 8.5.
1313

tests/_support/Helper/GFHelpers/ExpectedFormFields.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -484,21 +484,21 @@ public function pen_size_setting( GF_Field $field, array &$properties ): void {
484484
public function phone_format_setting( GF_Field $field, array &$properties ): void {
485485
$properties[] = $this->expectedField( 'phoneFormatType', ! empty( $field->phoneFormat ) ? GFHelpers::get_enum_for_value( Enum\PhoneFieldFormatEnum::$type, $field->phoneFormat ) : self::IS_NULL );
486486

487-
// Add _phoneFormatExperimental field.
487+
// Add phoneFormat field.
488488
if ( ! empty( $field->phoneFormat ) ) {
489-
$properties[] = $this->expectedField( '_phoneFormatExperimental.label', self::NOT_NULL );
490-
$properties[] = $this->expectedField( '_phoneFormatExperimental.type', self::NOT_NULL );
489+
$properties[] = $this->expectedField( 'phoneFormat.label', self::NOT_NULL );
490+
$properties[] = $this->expectedField( 'phoneFormat.type', self::NOT_NULL );
491491
if ( 'international' === $field->phoneFormat ) {
492-
$properties[] = $this->expectedField( '_phoneFormatExperimental.mask', self::IS_NULL );
493-
$properties[] = $this->expectedField( '_phoneFormatExperimental.regex', self::IS_NULL );
494-
$properties[] = $this->expectedField( '_phoneFormatExperimental.instruction', self::IS_NULL );
492+
$properties[] = $this->expectedField( 'phoneFormat.mask', self::IS_NULL );
493+
$properties[] = $this->expectedField( 'phoneFormat.regex', self::IS_NULL );
494+
$properties[] = $this->expectedField( 'phoneFormat.instruction', self::IS_NULL );
495495
} else {
496-
$properties[] = $this->expectedField( '_phoneFormatExperimental.mask', self::NOT_NULL );
497-
$properties[] = $this->expectedField( '_phoneFormatExperimental.regex', self::NOT_NULL );
498-
$properties[] = $this->expectedField( '_phoneFormatExperimental.instruction', self::NOT_NULL );
496+
$properties[] = $this->expectedField( 'phoneFormat.mask', self::NOT_NULL );
497+
$properties[] = $this->expectedField( 'phoneFormat.regex', self::NOT_NULL );
498+
$properties[] = $this->expectedField( 'phoneFormat.instruction', self::NOT_NULL );
499499
}
500500
} else {
501-
$properties[] = $this->expectedField( '_phoneFormatExperimental', self::IS_NULL );
501+
$properties[] = $this->expectedField( 'phoneFormat', self::IS_NULL );
502502
}
503503
}
504504

tests/wpunit/PhoneFieldFormatTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testStandardPhoneFormat(): void {
6969
nodes {
7070
... on PhoneField {
7171
phoneFormatType
72-
_phoneFormatExperimental {
72+
phoneFormat {
7373
label
7474
mask
7575
regex
@@ -89,7 +89,7 @@ public function testStandardPhoneFormat(): void {
8989
$this->assertArrayNotHasKey( 'errors', $response );
9090
$this->assertEquals( 'STANDARD', $response['data']['gfForm']['formFields']['nodes'][0]['phoneFormatType'] );
9191

92-
$properties = $response['data']['gfForm']['formFields']['nodes'][0]['_phoneFormatExperimental'];
92+
$properties = $response['data']['gfForm']['formFields']['nodes'][0]['phoneFormat'];
9393
$this->assertNotNull( $properties );
9494
$this->assertNotNull( $properties['label'] );
9595
$this->assertNotNull( $properties['mask'] );
@@ -111,7 +111,7 @@ public function testInternationalPhoneFormat(): void {
111111
nodes {
112112
... on PhoneField {
113113
phoneFormatType
114-
_phoneFormatExperimental {
114+
phoneFormat {
115115
label
116116
mask
117117
regex
@@ -131,7 +131,7 @@ public function testInternationalPhoneFormat(): void {
131131
$this->assertArrayNotHasKey( 'errors', $response );
132132
$this->assertEquals( 'INTERNATIONAL', $response['data']['gfForm']['formFields']['nodes'][0]['phoneFormatType'] );
133133

134-
$properties = $response['data']['gfForm']['formFields']['nodes'][0]['_phoneFormatExperimental'];
134+
$properties = $response['data']['gfForm']['formFields']['nodes'][0]['phoneFormat'];
135135
$this->assertNotNull( $properties );
136136
$this->assertNotNull( $properties['label'] );
137137
$this->assertNull( $properties['mask'] );
@@ -177,7 +177,7 @@ static function ( $formats ) use ( $custom_format ) {
177177
formFields {
178178
nodes {
179179
... on PhoneField {
180-
_phoneFormatExperimental {
180+
phoneFormat {
181181
label
182182
mask
183183
regex
@@ -195,7 +195,7 @@ static function ( $formats ) use ( $custom_format ) {
195195

196196
$this->assertArrayNotHasKey( 'errors', $response );
197197

198-
$properties = $response['data']['gfForm']['formFields']['nodes'][0]['_phoneFormatExperimental'];
198+
$properties = $response['data']['gfForm']['formFields']['nodes'][0]['phoneFormat'];
199199
$this->assertNotNull( $properties );
200200
$this->assertEquals( $custom_format['label'], $properties['label'] );
201201
$this->assertEquals( $custom_format['mask'], $properties['mask'] );

tests/wpunit/PhoneFieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function field_query(): string {
116116
shouldExport
117117
}
118118
phoneFormatType
119-
_phoneFormatExperimental {
119+
phoneFormat {
120120
label
121121
mask
122122
regex

0 commit comments

Comments
 (0)