Skip to content

Commit

Permalink
Style: Clean whitespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
theodesp committed Jan 4, 2024
1 parent 4e4c116 commit 9e3f610
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/unit/blocks/CoreTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
final class CoreTableTest extends PluginTestCase {
public $instance;
public $post_id;
public function setUp(): void {

public function setUp(): void {
parent::setUp();
global $wpdb;

Expand All @@ -18,21 +18,21 @@ public function setUp(): void {
' ',
trim(
'
<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout">
<thead><tr><th>Header 1</th><th>Header 2</th></tr></thead>
<tbody><tr><td></td><td></td></tr><tr><td></td><td></td></tr></tbody><tfoot><tr><td>Footer 1</td><td>Footer 2</td></tr></tfoot></table>
<figcaption class="wp-element-caption">Caption</figcaption></figure>
<!-- /wp:table -->
'
<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout">
<thead><tr><th>Header 1</th><th>Header 2</th></tr></thead>
<tbody><tr><td></td><td></td></tr><tr><td></td><td></td></tr></tbody><tfoot><tr><td>Footer 1</td><td>Footer 2</td></tr></tfoot></table>
<figcaption class="wp-element-caption">Caption</figcaption></figure>
<!-- /wp:table -->
'
)
),
'post_status' => 'publish',
)
);
}

public function tearDown(): void {
public function tearDown(): void {
parent::tearDown();
wp_delete_post( $this->post_id, true );
}
Expand All @@ -41,17 +41,17 @@ public function test_retrieve_core_table_attribute_fields() {
$query = '
fragment CoreTableBlockFragment on CoreTable {
attributes {
caption
align
anchor
caption
align
anchor
}
}
query GetPosts {
posts(first: 1) {
nodes {
editorBlocks {
name
name
...CoreTableBlockFragment
}
}
Expand All @@ -60,13 +60,13 @@ public function test_retrieve_core_table_attribute_fields() {
';
$actual = graphql( array( 'query' => $query ) );
$node = $actual['data']['posts']['nodes'][0];
$this->assertEquals( $node['editorBlocks'][0]['name'], 'core/table' );
// There should be only one block using that query when not using flat: true
$this->assertEquals( $node['editorBlocks'][0]['name'], 'core/table' );
// There should be only one block using that query when not using flat: true
$this->assertEquals( count( $node['editorBlocks'] ), 1 );
$this->assertEquals( $node['editorBlocks'][0]['attributes'], [
"caption" => "Caption",
'align' => null,
'anchor' => null
]);
$this->assertEquals( $node['editorBlocks'][0]['attributes'], [
'caption' => "Caption",
'align' => null,
'anchor' => null
]);
}
}

0 comments on commit 9e3f610

Please sign in to comment.