-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from bigbite/release/0.6.0
Release 0.6.0
- Loading branch information
Showing
39 changed files
with
642 additions
and
402 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
use WP_Cypress\Seeder\Seeder; | ||
use WP_Cypress\Fixtures; | ||
|
||
class DefaultSeeder extends Seeder { | ||
public function run() { | ||
( new Fixtures\Post() )->create( 3 ); | ||
|
||
$this->call([ | ||
'ExampleSeeder', | ||
]); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use WP_Cypress\Fixtures\Fixture; | ||
use WP_Cypress\Utils; | ||
|
||
class ExampleCommentFixture extends Fixture { | ||
/** | ||
* Gets default values of the comment. | ||
* | ||
* @return array | ||
*/ | ||
public function defaults(): array { | ||
return [ | ||
'comment_post_ID' => 1, | ||
'comment_author' => 'admin', | ||
'comment_author_email' => '[email protected]', | ||
'comment_content' => 'This is an example comment fixture', | ||
'user_id' => 1, | ||
'comment_date' => Utils\now(), | ||
]; | ||
} | ||
|
||
/** | ||
* Generates a comment record. | ||
* | ||
* @return void | ||
*/ | ||
public function generate(): void { | ||
$id = (int) wp_insert_comment( array_merge( $this->defaults(), $this->properties ) ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
use WP_Cypress\Seeder\Seeder; | ||
use WP_Cypress\Fixtures; | ||
|
||
class ExampleSeeder extends Seeder { | ||
public function run() { | ||
( new Fixtures\Post([ | ||
'import_id' => 10, | ||
'post_title' => 'Post with Custom Comments', | ||
]) )->create(); | ||
|
||
( new ExampleCommentFixture( [ 'comment_post_ID' => 10 ] ) )->create( 10 ); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.