Skip to content

Commit 43b778d

Browse files
committed
- update test to check if the test implements functions before setting up the test
1 parent 39448e6 commit 43b778d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/_support/WPUnit/AcfFieldTestCase.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,13 +1051,6 @@ public function testQueryFieldOnPostReturnsExpectedValue() {
10511051

10521052
public function testQueryFieldOnPostAsPreviewReturnsExpectedValue() {
10531053

1054-
// disable the block editor
1055-
add_filter('use_block_editor_for_post', '__return_false');
1056-
1057-
$field_key = $this->register_acf_field();
1058-
1059-
// Save data to the post
1060-
update_field( $field_key, $this->get_data_to_store(), $this->published_post->ID );
10611054

10621055
$fragment = $this->get_query_fragment();
10631056

@@ -1083,6 +1076,14 @@ public function testQueryFieldOnPostAsPreviewReturnsExpectedValue() {
10831076
$this->markTestIncomplete( 'get_preview_data_to_store() not defined' );
10841077
}
10851078

1079+
// disable the block editor
1080+
add_filter('use_block_editor_for_post', '__return_false');
1081+
1082+
$field_key = $this->register_acf_field();
1083+
1084+
// Save data to the post
1085+
update_field( $field_key, $this->get_data_to_store(), $this->published_post->ID );
1086+
10861087
$query = '
10871088
query AcfFieldOnPost ($id: ID! $asPreview:Boolean) {
10881089
post( id: $id idType: DATABASE_ID asPreview: $asPreview) {

0 commit comments

Comments
 (0)