Skip to content

Commit

Permalink
Create translation
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Feb 20, 2024
1 parent 3a4b93d commit cb0d4e4
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion tests/stats-listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@ public function setUp(): void {
}

public function test_stores_translation_created() {
$this->assertTrue( true );
$this->event_factory->create();

$this->set_normal_user_as_current();
$user_id = wp_get_current_user()->ID;

$set = $this->factory->translation_set->create_with_project_and_locale();
$original = $this->factory->original->create(
array(
'project_id' => $set->project->id,
'status' => '+active',
'singular' => 'foo',
)
);

$translation = $this->factory->translation->create(
array(
'user_id' => $user_id,
'translation_set_id' => $set->id,
'original_id' => $original->id,
'status' => 'waiting',
)
);

global $wpdb;
// phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery
// phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching
$rows = $wpdb->get_results( 'select * from wp_wporg_gp_translation_events_actions' );
// phpcs:enable

// TODO.
$this->assertNotEmpty( $rows );
}
}

0 comments on commit cb0d4e4

Please sign in to comment.