PluginProbe
Extendify / 3.0.6
Extendify v3.0.6
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / tests / Integration / Shared / Services / Import / PostTest.php

PostTest.php in Extendify 3.0.6, at tests/Integration/Shared/Services/Import/PostTest.php

34 lines 933 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Extendify\Tests\Integration\Shared\Services\Import;
4
5 use Extendify\Shared\Services\Import\Post;
6 use WP_UnitTestCase;
7
8 class PostTest extends WP_UnitTestCase
9 {
10 public function test_is_locked_returns_true_when_lock_is_fresh()
11 {
12 $postId = self::factory()->post->create();
13 update_post_meta($postId, '_edit_lock', time() . ':1');
14
15 $this->assertTrue(Post::isLocked($postId));
16 }
17
18 public function test_is_locked_returns_false_when_lock_is_expired()
19 {
20 $postId = self::factory()->post->create();
21 // Set a lock that expired 200s ago (window is 150s).
22 update_post_meta($postId, '_edit_lock', (time() - 200) . ':1');
23
24 $this->assertFalse(Post::isLocked($postId));
25 }
26
27 public function test_is_locked_returns_false_when_no_lock()
28 {
29 $postId = self::factory()->post->create();
30
31 $this->assertFalse(Post::isLocked($postId));
32 }
33 }
34