1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
||
31 | class Repeat_Visitor_Block_Test extends \Jetpack_Block_Fixture_TestCase { |
||
32 | /** |
||
33 | * A variable to track whether or not the block was already registered before the test was run. |
||
34 | * |
||
35 | * @access private |
||
36 | * |
||
37 | * @var boolean |
||
38 | */ |
||
39 | private $was_registered = false; |
||
40 | |||
41 | /** |
||
42 | * A variable to track the current cookie value of repeat visits. |
||
43 | * |
||
44 | * @access private |
||
45 | * |
||
46 | * @var number |
||
47 | */ |
||
48 | private $original_visit_counter; |
||
49 | |||
50 | /** |
||
51 | * The name of the block under test. |
||
52 | * |
||
53 | * @access private |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | const BLOCK_NAME = 'jetpack/repeat-visitor'; |
||
58 | |||
59 | /** |
||
60 | * Setup and ensure the block is registered before running the tests. |
||
61 | * |
||
62 | * @before |
||
63 | */ |
||
64 | public function setUp() { |
||
73 | |||
74 | /** |
||
75 | * Teardown and unregister the block if it wasn't registered before running these tests. |
||
76 | * |
||
77 | * @after |
||
78 | */ |
||
79 | public function tearDown() { |
||
90 | |||
91 | /** |
||
92 | * Test that the block is registered, which means that it can be registered. |
||
93 | */ |
||
94 | public function test_block_can_be_registered() { |
||
98 | |||
99 | /** |
||
100 | * Set the visit counter to zero, and test the serialized fixtures as though the visitor |
||
101 | * is below the Repeat Visitor block's threshold. |
||
102 | * |
||
103 | * This will generate server-rendered fixtures if they do not exist. |
||
104 | */ |
||
105 | public function test_server_side_rendering_based_on_serialized_fixtures_below_threshold() { |
||
114 | |||
115 | /** |
||
116 | * Set the visit counter to zero, and test the serialized fixtures as though the visitor |
||
117 | * is above the Repeat Visitor block's threshold. |
||
118 | * |
||
119 | * This will generate server-rendered fixtures if they do not exist. |
||
120 | */ |
||
121 | public function test_server_side_rendering_based_on_serialized_fixtures_above_threshold() { |
||
130 | } |
||
131 |