-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReleaseNoteSeeder.php
More file actions
101 lines (84 loc) · 2.31 KB
/
ReleaseNoteSeeder.php
File metadata and controls
101 lines (84 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
use WP_Cypress\Seeder\Seeder;
use WP_Cypress\Fixtures;
class ReleaseNoteSeeder extends Seeder {
public function run() {
$release_note_template = '<!-- wp:heading -->
<h2 class="wp-block-heading">Overview</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p> %s </p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Added</h2>
<!-- /wp:heading -->
<!-- wp:list -->
<ul><!-- wp:list-item -->
<li> %s </li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li> %s </li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Changed</h2>
<!-- /wp:heading -->
<!-- wp:list -->
<ul><!-- wp:list-item -->
<li> %s </li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li> %s </li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Fixed</h2>
<!-- /wp:heading -->
<!-- wp:list -->
<ul><!-- wp:list-item -->
<li> %s </li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li> %s </li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->';
( new Fixtures\Post([
'post_type' => 'release-note',
'post_date' => date("Y-m-d H:i:s", strtotime("Nov 10, 2023 15:01:10")),
'post_content' => sprintf(
$release_note_template,
$this->faker->realText( 100 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
'1.5.0'
),
'post_meta' => [
'version' => '1.5.0',
'release_date' => date("Y-m-d", strtotime("Nov 10, 2023")),
]
]))->create(1);
( new Fixtures\Post([
'post_type' => 'release-note',
'post_date' => date("Y-m-d H:i:s", strtotime("Dec 04, 2023 14:22:32")),
'post_content' => sprintf(
$release_note_template,
$this->faker->realText( 100 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
$this->faker->realText( 40 ),
'1.6.0'
),
'post_meta' => [
'version' => '1.6.0',
'release_date' => date("Y-m-d", strtotime("Dec 04, 2023")),
],
]))->create(1);
}
}