Skip to content

Commit d66d532

Browse files
committed
Fix tests for new table.
1 parent 0d49cab commit d66d532

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/phpunit/tests/collaboration/wpCollaborationTableStorage.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public function test_duplicate_awareness_rows_coalesces_on_latest_row() {
307307
'type' => 'awareness',
308308
'client_id' => '1',
309309
'user_id' => 1,
310-
'data' => wp_json_encode( array( 1 => array( 'name' => 'Stale' ) ) ),
310+
'data' => wp_json_encode( array( 'name' => 'Stale' ) ),
311311
),
312312
array( '%s', '%s', '%s', '%d', '%s' )
313313
);
@@ -319,17 +319,19 @@ public function test_duplicate_awareness_rows_coalesces_on_latest_row() {
319319
'type' => 'awareness',
320320
'client_id' => '1',
321321
'user_id' => 1,
322-
'data' => wp_json_encode( array( 1 => array( 'name' => 'Latest' ) ) ),
322+
'data' => wp_json_encode( array( 'name' => 'Latest' ) ),
323323
),
324324
array( '%s', '%s', '%s', '%d', '%s' )
325325
);
326326

327327
// get_awareness_state and set_awareness_state should target the latest row.
328328
wp_cache_flush();
329329
$awareness = $storage->get_awareness_state( $room );
330+
$this->assertCount( 1, $awareness, 'Only one awareness state should be returned for the client.' );
330331
$this->assertSame( array( 'name' => 'Latest' ), $awareness[0] );
331332
$storage->set_awareness_state( $room, '1', array( 'name' => 'Current' ), 1 );
332333
$awareness = $storage->get_awareness_state( $room );
334+
$this->assertCount( 1, $awareness, 'Only one awareness state should be returned for the client.' );
333335
$this->assertSame( array( 'name' => 'Current' ), $awareness[0] );
334336
}
335337
}

0 commit comments

Comments
 (0)