• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 6892223656

16 Nov 2023 02:35PM UTC coverage: 49.203% (-0.08%) from 49.287%
6892223656

Pull #20470

github

thijsoo
Fix unit tests.
Pull Request #20470: Introduces indexables verification cron

129 of 283 new or added lines in 25 files covered. (45.58%)

652 existing lines in 2 files now uncovered.

13368 of 27169 relevant lines covered (49.2%)

3.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/indexables/application/verification-cron-batch-handler.php
1
<?php
2

3
namespace Yoast\WP\SEO\Indexables\Application;
4

5
use Yoast\WP\SEO\Helpers\Options_Helper;
6
use Yoast\WP\SEO\Indexables\Domain\Batch_Size;
7
use Yoast\WP\SEO\Indexables\Domain\Last_Batch_Count;
8

9
/**
10
 * The Verification_Cron_Batch_Handler class.
11
 */
12
class Verification_Cron_Batch_Handler {
13

14
        /**
15
         * The Options_Helper instance.
16
         *
17
         * @var Options_Helper
18
         */
19
        protected $options_helper;
20

21
        /**
22
         * The constructor.
23
         *
24
         * @param Options_Helper $options_helper The options helper.
25
         */
26
        public function __construct( Options_Helper $options_helper ) {
NEW
27
                $this->options_helper = $options_helper;
×
28
        }
29

30
        /**
31
         * Gets the `cron_verify_post_indexables_last_batch` option.
32
         *
33
         * @return int
34
         */
35
        public function get_current_post_indexables_batch(): int {
36
                return $this->options_helper->get( 'cron_verify_post_indexables_last_batch', 0 );
2✔
37
        }
38

39
        /**
40
         * Sets the `cron_verify_post_indexables_last_batch` option.
41
         *
42
         * @param Last_Batch_Count $last_batch_count The current batch count.
43
         * @param Batch_Size       $batch_size       The batch size.
44
         *
45
         * @return void
46
         */
47
        public function set_current_post_indexables_batch(
48
                Last_Batch_Count $last_batch_count,
49
                Batch_Size $batch_size
50
        ): void {
1✔
51
                $batch_count = ( $last_batch_count->get_last_batch() + $batch_size->get_batch_size() );
2✔
52
                $this->options_helper->set( 'cron_verify_post_indexables_last_batch', $batch_count );
2✔
53
        }
1✔
54

55
        /**
56
         * Gets the `cron_verify_non_timestamped_indexables_last_batch` option.
57
         *
58
         * @return int
59
         */
60
        public function get_current_non_timestamped_indexables_batch(): int {
61
                return $this->options_helper->get( 'cron_verify_non_timestamped_indexables_last_batch', 0 );
2✔
62
        }
63

64
        /**
65
         * Sets the `cron_verify_non_timestamped_indexables_last_batch` option.
66
         *
67
         * @param Last_Batch_Count $last_batch_count The current batch count.
68
         * @param Batch_Size       $batch_size       The batch size.
69
         *
70
         * @return void
71
         */
72
        public function set_current_non_timestamped_indexables_batch(
73
                Last_Batch_Count $last_batch_count,
74
                Batch_Size $batch_size
75
        ): void {
1✔
76
                $batch_count = ( $last_batch_count->get_last_batch() + $batch_size->get_batch_size() );
2✔
77
                $this->options_helper->set( 'cron_verify_non_timestamped_indexables_last_batch', $batch_count );
2✔
78
        }
1✔
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc