Skip to content

Commit

Permalink
- update test to check if the test implements functions before settin…
Browse files Browse the repository at this point in the history
…g up the test
  • Loading branch information
jasonbahl committed Mar 15, 2024
1 parent 39448e6 commit 43b778d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/_support/WPUnit/AcfFieldTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1051,13 +1051,6 @@ public function testQueryFieldOnPostReturnsExpectedValue() {

public function testQueryFieldOnPostAsPreviewReturnsExpectedValue() {

// disable the block editor
add_filter('use_block_editor_for_post', '__return_false');

$field_key = $this->register_acf_field();

// Save data to the post
update_field( $field_key, $this->get_data_to_store(), $this->published_post->ID );

$fragment = $this->get_query_fragment();

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

// disable the block editor
add_filter('use_block_editor_for_post', '__return_false');

$field_key = $this->register_acf_field();

// Save data to the post
update_field( $field_key, $this->get_data_to_store(), $this->published_post->ID );

$query = '
query AcfFieldOnPost ($id: ID! $asPreview:Boolean) {
post( id: $id idType: DATABASE_ID asPreview: $asPreview) {
Expand Down

0 comments on commit 43b778d

Please sign in to comment.