diff --git a/tests/unit/main-test.php b/tests/unit/main-test.php index 485db22587e..e462d963fec 100644 --- a/tests/unit/main-test.php +++ b/tests/unit/main-test.php @@ -54,12 +54,6 @@ protected function set_up() { global $wpdb; $wpdb = Mockery::mock( '\wpdb' ); - - // Some classes call the YoastSEO function in the constructor. - Monkey\Functions\expect( 'YoastSEO' ) - ->andReturn( $this->instance ); - // Deprecated classes call _deprecated_function in the constructor. - Monkey\Functions\expect( '_deprecated_function' ); } /** @@ -68,6 +62,13 @@ protected function set_up() { * @covers ::get_container */ public function test_surfaces() { + + // Some classes call the YoastSEO function in the constructor. + Monkey\Functions\expect( 'YoastSEO' ) + ->andReturn( $this->instance ); + // Deprecated classes call _deprecated_function in the constructor. + Monkey\Functions\expect( '_deprecated_function' ); + $container = $this->instance->get_container(); foreach ( $container->getServiceIds() as $service_id ) {