Skip to content

Commit

Permalink
Add event factory
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Feb 20, 2024
1 parent bf1e542 commit dacefcf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/lib/event-factory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Wporg\TranslationEvents\Tests;

use WP_UnitTest_Factory_For_Post;
use WP_UnitTest_Generator_Sequence;

class Event_Factory extends WP_UnitTest_Factory_For_Post {
public function __construct( $factory = null ) {
parent::__construct( $factory );
$this->default_generation_definitions = array(
'post_status' => 'publish',
'post_title' => new WP_UnitTest_Generator_Sequence( 'Event title %s' ),
'post_content' => new WP_UnitTest_Generator_Sequence( 'Event content %s' ),
'post_excerpt' => new WP_UnitTest_Generator_Sequence( 'Event excerpt %s' ),
'post_type' => 'event',
);
}
}

0 comments on commit dacefcf

Please sign in to comment.