diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index 021902602..c02201fd1 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -42,21 +42,19 @@ class Post extends Indexable { public $support_indexing_advanced_pagination = true; /** - * Create indexable and initialize dependencies + * Instantiate the indexable SyncManager and QueryIntegration * - * @since 3.0 + * @since 5.2.0 + * @return void */ - public function __construct() { - - $this->sync_manager = new SyncManager( $this->slug ); - $this->query_integration = new QueryIntegration( $this->slug ); - } - public function setup() { $this->labels = [ 'plural' => esc_html__( 'Posts', 'elasticpress' ), 'singular' => esc_html__( 'Post', 'elasticpress' ), ]; + + $this->sync_manager = new SyncManager( $this->slug ); + $this->query_integration = new QueryIntegration( $this->slug ); } /** diff --git a/tests/php/features/TestAutosuggest.php b/tests/php/features/TestAutosuggest.php index 953da07c0..e4501dad4 100644 --- a/tests/php/features/TestAutosuggest.php +++ b/tests/php/features/TestAutosuggest.php @@ -68,6 +68,7 @@ protected function get_feature() { */ public function testConstruct() { $instance = new ElasticPress\Feature\Autosuggest\Autosuggest(); + $instance->set_i18n_strings(); $this->assertEquals( 'autosuggest', $instance->slug ); $this->assertEquals( 'Autosuggest', $instance->title ); diff --git a/tests/php/features/TestComments.php b/tests/php/features/TestComments.php index f6e8309ca..89cd70eaa 100644 --- a/tests/php/features/TestComments.php +++ b/tests/php/features/TestComments.php @@ -73,6 +73,7 @@ protected function get_feature() { */ public function testConstruct() { $instance = new ElasticPress\Feature\Comments\Comments(); + $instance->set_i18n_strings(); $this->assertEquals( 'comments', $instance->slug ); $this->assertEquals( 'Comments', $instance->title ); diff --git a/tests/php/features/TestDidYouMean.php b/tests/php/features/TestDidYouMean.php index befbe8926..ff3015924 100644 --- a/tests/php/features/TestDidYouMean.php +++ b/tests/php/features/TestDidYouMean.php @@ -43,6 +43,7 @@ public function set_up() { */ public function testConstruct() { $instance = new ElasticPress\Feature\DidYouMean\DidYouMean(); + $instance->set_i18n_strings(); $this->assertEquals( 'did-you-mean', $instance->slug ); $this->assertEquals( 'Did You Mean', $instance->title ); diff --git a/tests/php/features/TestSearchOrdering.php b/tests/php/features/TestSearchOrdering.php index 2f2554672..924f89960 100644 --- a/tests/php/features/TestSearchOrdering.php +++ b/tests/php/features/TestSearchOrdering.php @@ -73,6 +73,8 @@ public function get_feature() { */ public function testConstruct() { $instance = new \ElasticPress\Feature\SearchOrdering\SearchOrdering(); + $instance->set_i18n_strings(); + $this->assertSame( 'searchordering', $instance->slug ); $this->assertSame( 'Custom Search Results', $instance->title ); } diff --git a/tests/php/indexables/TestPost.php b/tests/php/indexables/TestPost.php index d48e8d46d..b6c16fedd 100644 --- a/tests/php/indexables/TestPost.php +++ b/tests/php/indexables/TestPost.php @@ -6167,6 +6167,7 @@ function ( $args ) { public function testPostConstructor() { $post = new \ElasticPress\Indexable\Post\Post(); + $post->setup(); $this->assertSame( 'Posts', $post->labels['plural'] ); $this->assertSame( 'Post', $post->labels['singular'] );